/*
 * jQuery JavaScript Library v1.3.1
 * http://jquery.com/
 *
 * Copyright (c) 2009 John Resig
 * Dual licensed under the MIT and GPL licenses.
 * http://docs.jquery.com/License
 *
 * Date: 2009-01-21 20:42:16 -0500 (Wed, 21 Jan 2009)
 * Revision: 6158
 */
(function(){var window=this,undefined,_jQuery=window.jQuery,_$=window.$,jQuery=window.jQuery=window.$=function(selector,context){return new jQuery.fn.init(selector,context)
},quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,isSimple=/^.[^:#\[\.,]*$/;
jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;
if(selector.nodeType){this[0]=selector;
this.length=1;
this.context=selector;
return this
}if(typeof selector==="string"){var match=quickExpr.exec(selector);
if(match&&(match[1]||!context)){if(match[1]){selector=jQuery.clean([match[1]],context)
}else{var elem=document.getElementById(match[3]);
if(elem&&elem.id!=match[3]){return jQuery().find(selector)
}var ret=jQuery(elem||[]);
ret.context=document;
ret.selector=selector;
return ret
}}else{return jQuery(context).find(selector)
}}else{if(jQuery.isFunction(selector)){return jQuery(document).ready(selector)
}}if(selector.selector&&selector.context){this.selector=selector.selector;
this.context=selector.context
}return this.setArray(jQuery.makeArray(selector))
},selector:"",jquery:"1.3.1",size:function(){return this.length
},get:function(num){return num===undefined?jQuery.makeArray(this):this[num]
},pushStack:function(elems,name,selector){var ret=jQuery(elems);
ret.prevObject=this;
ret.context=this.context;
if(name==="find"){ret.selector=this.selector+(this.selector?" ":"")+selector
}else{if(name){ret.selector=this.selector+"."+name+"("+selector+")"
}}return ret
},setArray:function(elems){this.length=0;
Array.prototype.push.apply(this,elems);
return this
},each:function(callback,args){return jQuery.each(this,callback,args)
},index:function(elem){return jQuery.inArray(elem&&elem.jquery?elem[0]:elem,this)
},attr:function(name,value,type){var options=name;
if(typeof name==="string"){if(value===undefined){return this[0]&&jQuery[type||"attr"](this[0],name)
}else{options={};
options[name]=value
}}return this.each(function(i){for(name in options){jQuery.attr(type?this.style:this,name,jQuery.prop(this,options[name],type,i,name))
}})
},css:function(key,value){if((key=="width"||key=="height")&&parseFloat(value)<0){value=undefined
}return this.attr(key,value,"curCSS")
},text:function(text){if(typeof text!=="object"&&text!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text))
}var ret="";
jQuery.each(text||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8){ret+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this])
}})
});
return ret
},wrapAll:function(html){if(this[0]){var wrap=jQuery(html,this[0].ownerDocument).clone();
if(this[0].parentNode){wrap.insertBefore(this[0])
}wrap.map(function(){var elem=this;
while(elem.firstChild){elem=elem.firstChild
}return elem
}).append(this)
}return this
},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html)
})
},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html)
})
},append:function(){return this.domManip(arguments,true,function(elem){if(this.nodeType==1){this.appendChild(elem)
}})
},prepend:function(){return this.domManip(arguments,true,function(elem){if(this.nodeType==1){this.insertBefore(elem,this.firstChild)
}})
},before:function(){return this.domManip(arguments,false,function(elem){this.parentNode.insertBefore(elem,this)
})
},after:function(){return this.domManip(arguments,false,function(elem){this.parentNode.insertBefore(elem,this.nextSibling)
})
},end:function(){return this.prevObject||jQuery([])
},push:[].push,find:function(selector){if(this.length===1&&!/,/.test(selector)){var ret=this.pushStack([],"find",selector);
ret.length=0;
jQuery.find(selector,this[0],ret);
return ret
}else{var elems=jQuery.map(this,function(elem){return jQuery.find(selector,elem)
});
return this.pushStack(/[^+>] [^+>]/.test(selector)?jQuery.unique(elems):elems,"find",selector)
}},clone:function(events){var ret=this.map(function(){if(!jQuery.support.noCloneEvent&&!jQuery.isXMLDoc(this)){var clone=this.cloneNode(true),container=document.createElement("div");
container.appendChild(clone);
return jQuery.clean([container.innerHTML])[0]
}else{return this.cloneNode(true)
}});
var clone=ret.find("*").andSelf().each(function(){if(this[expando]!==undefined){this[expando]=null
}});
if(events===true){this.find("*").andSelf().each(function(i){if(this.nodeType==3){return 
}var events=jQuery.data(this,"events");
for(var type in events){for(var handler in events[type]){jQuery.event.add(clone[i],type,events[type][handler],events[type][handler].data)
}}})
}return ret
},filter:function(selector){return this.pushStack(jQuery.isFunction(selector)&&jQuery.grep(this,function(elem,i){return selector.call(elem,i)
})||jQuery.multiFilter(selector,jQuery.grep(this,function(elem){return elem.nodeType===1
})),"filter",selector)
},closest:function(selector){var pos=jQuery.expr.match.POS.test(selector)?jQuery(selector):null;
return this.map(function(){var cur=this;
while(cur&&cur.ownerDocument){if(pos?pos.index(cur)>-1:jQuery(cur).is(selector)){return cur
}cur=cur.parentNode
}})
},not:function(selector){if(typeof selector==="string"){if(isSimple.test(selector)){return this.pushStack(jQuery.multiFilter(selector,this,true),"not",selector)
}else{selector=jQuery.multiFilter(selector,this)
}}var isArrayLike=selector.length&&selector[selector.length-1]!==undefined&&!selector.nodeType;
return this.filter(function(){return isArrayLike?jQuery.inArray(this,selector)<0:this!=selector
})
},add:function(selector){return this.pushStack(jQuery.unique(jQuery.merge(this.get(),typeof selector==="string"?jQuery(selector):jQuery.makeArray(selector))))
},is:function(selector){return !!selector&&jQuery.multiFilter(selector,this).length>0
},hasClass:function(selector){return !!selector&&this.is("."+selector)
},val:function(value){if(value===undefined){var elem=this[0];
if(elem){if(jQuery.nodeName(elem,"option")){return(elem.attributes.value||{}).specified?elem.value:elem.text
}if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type=="select-one";
if(index<0){return null
}for(var i=one?index:0,max=one?index+1:options.length;
i<max;
i++){var option=options[i];
if(option.selected){value=jQuery(option).val();
if(one){return value
}values.push(value)
}}return values
}return(elem.value||"").replace(/\r/g,"")
}return undefined
}if(typeof value==="number"){value+=""
}return this.each(function(){if(this.nodeType!=1){return 
}if(jQuery.isArray(value)&&/radio|checkbox/.test(this.type)){this.checked=(jQuery.inArray(this.value,value)>=0||jQuery.inArray(this.name,value)>=0)
}else{if(jQuery.nodeName(this,"select")){var values=jQuery.makeArray(value);
jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,values)>=0||jQuery.inArray(this.text,values)>=0)
});
if(!values.length){this.selectedIndex=-1
}}else{this.value=value
}}})
},html:function(value){return value===undefined?(this[0]?this[0].innerHTML:null):this.empty().append(value)
},replaceWith:function(value){return this.after(value).remove()
},eq:function(i){return this.slice(i,+i+1)
},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))
},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem)
}))
},andSelf:function(){return this.add(this.prevObject)
},domManip:function(args,table,callback){if(this[0]){var fragment=(this[0].ownerDocument||this[0]).createDocumentFragment(),scripts=jQuery.clean(args,(this[0].ownerDocument||this[0]),fragment),first=fragment.firstChild,extra=this.length>1?fragment.cloneNode(true):fragment;
if(first){for(var i=0,l=this.length;
i<l;
i++){callback.call(root(this[i],first),i>0?extra.cloneNode(true):fragment)
}}if(scripts){jQuery.each(scripts,evalScript)
}}return this;
function root(elem,cur){return table&&jQuery.nodeName(elem,"table")&&jQuery.nodeName(cur,"tr")?(elem.getElementsByTagName("tbody")[0]||elem.appendChild(elem.ownerDocument.createElement("tbody"))):elem
}}};
jQuery.fn.init.prototype=jQuery.fn;
function evalScript(i,elem){if(elem.src){jQuery.ajax({url:elem.src,async:false,dataType:"script"})
}else{jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"")
}if(elem.parentNode){elem.parentNode.removeChild(elem)
}}function now(){return +new Date
}jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options;
if(typeof target==="boolean"){deep=target;
target=arguments[1]||{};
i=2
}if(typeof target!=="object"&&!jQuery.isFunction(target)){target={}
}if(length==i){target=this;
--i
}for(;
i<length;
i++){if((options=arguments[i])!=null){for(var name in options){var src=target[name],copy=options[name];
if(target===copy){continue
}if(deep&&copy&&typeof copy==="object"&&!copy.nodeType){target[name]=jQuery.extend(deep,src||(copy.length!=null?[]:{}),copy)
}else{if(copy!==undefined){target[name]=copy
}}}}}return target
};
var exclude=/z-?index|font-?weight|opacity|zoom|line-?height/i,defaultView=document.defaultView||{},toString=Object.prototype.toString;
jQuery.extend({noConflict:function(deep){window.$=_$;
if(deep){window.jQuery=_jQuery
}return jQuery
},isFunction:function(obj){return toString.call(obj)==="[object Function]"
},isArray:function(obj){return toString.call(obj)==="[object Array]"
},isXMLDoc:function(elem){return elem.nodeType===9&&elem.documentElement.nodeName!=="HTML"||!!elem.ownerDocument&&jQuery.isXMLDoc(elem.ownerDocument)
},globalEval:function(data){data=jQuery.trim(data);
if(data){var head=document.getElementsByTagName("head")[0]||document.documentElement,script=document.createElement("script");
script.type="text/javascript";
if(jQuery.support.scriptEval){script.appendChild(document.createTextNode(data))
}else{script.text=data
}head.insertBefore(script,head.firstChild);
head.removeChild(script)
}},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()==name.toUpperCase()
},each:function(object,callback,args){var name,i=0,length=object.length;
if(args){if(length===undefined){for(name in object){if(callback.apply(object[name],args)===false){break
}}}else{for(;
i<length;
){if(callback.apply(object[i++],args)===false){break
}}}}else{if(length===undefined){for(name in object){if(callback.call(object[name],name,object[name])===false){break
}}}else{for(var value=object[0];
i<length&&callback.call(value,i,value)!==false;
value=object[++i]){}}}return object
},prop:function(elem,value,type,i,name){if(jQuery.isFunction(value)){value=value.call(elem,i)
}return typeof value==="number"&&type=="curCSS"&&!exclude.test(name)?value+"px":value
},className:{add:function(elem,classNames){jQuery.each((classNames||"").split(/\s+/),function(i,className){if(elem.nodeType==1&&!jQuery.className.has(elem.className,className)){elem.className+=(elem.className?" ":"")+className
}})
},remove:function(elem,classNames){if(elem.nodeType==1){elem.className=classNames!==undefined?jQuery.grep(elem.className.split(/\s+/),function(className){return !jQuery.className.has(classNames,className)
}).join(" "):""
}},has:function(elem,className){return elem&&jQuery.inArray(className,(elem.className||elem).toString().split(/\s+/))>-1
}},swap:function(elem,options,callback){var old={};
for(var name in options){old[name]=elem.style[name];
elem.style[name]=options[name]
}callback.call(elem);
for(var name in options){elem.style[name]=old[name]
}},css:function(elem,name,force){if(name=="width"||name=="height"){var val,props={position:"absolute",visibility:"hidden",display:"block"},which=name=="width"?["Left","Right"]:["Top","Bottom"];
function getWH(){val=name=="width"?elem.offsetWidth:elem.offsetHeight;
var padding=0,border=0;
jQuery.each(which,function(){padding+=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0;
border+=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0
});
val-=Math.round(padding+border)
}if(jQuery(elem).is(":visible")){getWH()
}else{jQuery.swap(elem,props,getWH)
}return Math.max(0,val)
}return jQuery.curCSS(elem,name,force)
},curCSS:function(elem,name,force){var ret,style=elem.style;
if(name=="opacity"&&!jQuery.support.opacity){ret=jQuery.attr(style,"opacity");
return ret==""?"1":ret
}if(name.match(/float/i)){name=styleFloat
}if(!force&&style&&style[name]){ret=style[name]
}else{if(defaultView.getComputedStyle){if(name.match(/float/i)){name="float"
}name=name.replace(/([A-Z])/g,"-$1").toLowerCase();
var computedStyle=defaultView.getComputedStyle(elem,null);
if(computedStyle){ret=computedStyle.getPropertyValue(name)
}if(name=="opacity"&&ret==""){ret="1"
}}else{if(elem.currentStyle){var camelCase=name.replace(/\-(\w)/g,function(all,letter){return letter.toUpperCase()
});
ret=elem.currentStyle[name]||elem.currentStyle[camelCase];
if(!/^\d+(px)?$/i.test(ret)&&/^\d/.test(ret)){var left=style.left,rsLeft=elem.runtimeStyle.left;
elem.runtimeStyle.left=elem.currentStyle.left;
style.left=ret||0;
ret=style.pixelLeft+"px";
style.left=left;
elem.runtimeStyle.left=rsLeft
}}}}return ret
},clean:function(elems,context,fragment){context=context||document;
if(typeof context.createElement==="undefined"){context=context.ownerDocument||context[0]&&context[0].ownerDocument||document
}if(!fragment&&elems.length===1&&typeof elems[0]==="string"){var match=/^<(\w+)\s*\/?>$/.exec(elems[0]);
if(match){return[context.createElement(match[1])]
}}var ret=[],scripts=[],div=context.createElement("div");
jQuery.each(elems,function(i,elem){if(typeof elem==="number"){elem+=""
}if(!elem){return 
}if(typeof elem==="string"){elem=elem.replace(/(<(\w+)[^>]*?)\/>/g,function(all,front,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?all:front+"></"+tag+">"
});
var tags=jQuery.trim(elem).toLowerCase();
var wrap=!tags.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!tags.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||tags.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!tags.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!tags.indexOf("<td")||!tags.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!tags.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!jQuery.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];
div.innerHTML=wrap[1]+elem+wrap[2];
while(wrap[0]--){div=div.lastChild
}if(!jQuery.support.tbody){var tbody=!tags.indexOf("<table")&&tags.indexOf("<tbody")<0?div.firstChild&&div.firstChild.childNodes:wrap[1]=="<table>"&&tags.indexOf("<tbody")<0?div.childNodes:[];
for(var j=tbody.length-1;
j>=0;
--j){if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length){tbody[j].parentNode.removeChild(tbody[j])
}}}if(!jQuery.support.leadingWhitespace&&/^\s/.test(elem)){div.insertBefore(context.createTextNode(elem.match(/^\s*/)[0]),div.firstChild)
}elem=jQuery.makeArray(div.childNodes)
}if(elem.nodeType){ret.push(elem)
}else{ret=jQuery.merge(ret,elem)
}});
if(fragment){for(var i=0;
ret[i];
i++){if(jQuery.nodeName(ret[i],"script")&&(!ret[i].type||ret[i].type.toLowerCase()==="text/javascript")){scripts.push(ret[i].parentNode?ret[i].parentNode.removeChild(ret[i]):ret[i])
}else{if(ret[i].nodeType===1){ret.splice.apply(ret,[i+1,0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))))
}fragment.appendChild(ret[i])
}}return scripts
}return ret
},attr:function(elem,name,value){if(!elem||elem.nodeType==3||elem.nodeType==8){return undefined
}var notxml=!jQuery.isXMLDoc(elem),set=value!==undefined;
name=notxml&&jQuery.props[name]||name;
if(elem.tagName){var special=/href|src|style/.test(name);
if(name=="selected"&&elem.parentNode){elem.parentNode.selectedIndex
}if(name in elem&&notxml&&!special){if(set){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode){throw"type property can't be changed"
}elem[name]=value
}if(jQuery.nodeName(elem,"form")&&elem.getAttributeNode(name)){return elem.getAttributeNode(name).nodeValue
}if(name=="tabIndex"){var attributeNode=elem.getAttributeNode("tabIndex");
return attributeNode&&attributeNode.specified?attributeNode.value:elem.nodeName.match(/(button|input|object|select|textarea)/i)?0:elem.nodeName.match(/^(a|area)$/i)&&elem.href?0:undefined
}return elem[name]
}if(!jQuery.support.style&&notxml&&name=="style"){return jQuery.attr(elem.style,"cssText",value)
}if(set){elem.setAttribute(name,""+value)
}var attr=!jQuery.support.hrefNormalized&&notxml&&special?elem.getAttribute(name,2):elem.getAttribute(name);
return attr===null?undefined:attr
}if(!jQuery.support.opacity&&name=="opacity"){if(set){elem.zoom=1;
elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(value)+""=="NaN"?"":"alpha(opacity="+value*100+")")
}return elem.filter&&elem.filter.indexOf("opacity=")>=0?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100)+"":""
}name=name.replace(/-([a-z])/ig,function(all,letter){return letter.toUpperCase()
});
if(set){elem[name]=value
}return elem[name]
},trim:function(text){return(text||"").replace(/^\s+|\s+$/g,"")
},makeArray:function(array){var ret=[];
if(array!=null){var i=array.length;
if(i==null||typeof array==="string"||jQuery.isFunction(array)||array.setInterval){ret[0]=array
}else{while(i){ret[--i]=array[i]
}}}return ret
},inArray:function(elem,array){for(var i=0,length=array.length;
i<length;
i++){if(array[i]===elem){return i
}}return -1
},merge:function(first,second){var i=0,elem,pos=first.length;
if(!jQuery.support.getAll){while((elem=second[i++])!=null){if(elem.nodeType!=8){first[pos++]=elem
}}}else{while((elem=second[i++])!=null){first[pos++]=elem
}}return first
},unique:function(array){var ret=[],done={};
try{for(var i=0,length=array.length;
i<length;
i++){var id=jQuery.data(array[i]);
if(!done[id]){done[id]=true;
ret.push(array[i])
}}}catch(e){ret=array
}return ret
},grep:function(elems,callback,inv){var ret=[];
for(var i=0,length=elems.length;
i<length;
i++){if(!inv!=!callback(elems[i],i)){ret.push(elems[i])
}}return ret
},map:function(elems,callback){var ret=[];
for(var i=0,length=elems.length;
i<length;
i++){var value=callback(elems[i],i);
if(value!=null){ret[ret.length]=value
}}return ret.concat.apply([],ret)
}});
var userAgent=navigator.userAgent.toLowerCase();
jQuery.browser={version:(userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(userAgent),opera:/opera/.test(userAgent),msie:/msie/.test(userAgent)&&!/opera/.test(userAgent),mozilla:/mozilla/.test(userAgent)&&!/(compatible|webkit)/.test(userAgent)};
jQuery.each({parent:function(elem){return elem.parentNode
},parents:function(elem){return jQuery.dir(elem,"parentNode")
},next:function(elem){return jQuery.nth(elem,2,"nextSibling")
},prev:function(elem){return jQuery.nth(elem,2,"previousSibling")
},nextAll:function(elem){return jQuery.dir(elem,"nextSibling")
},prevAll:function(elem){return jQuery.dir(elem,"previousSibling")
},siblings:function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem)
},children:function(elem){return jQuery.sibling(elem.firstChild)
},contents:function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes)
}},function(name,fn){jQuery.fn[name]=function(selector){var ret=jQuery.map(this,fn);
if(selector&&typeof selector=="string"){ret=jQuery.multiFilter(selector,ret)
}return this.pushStack(jQuery.unique(ret),name,selector)
}
});
jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(){var args=arguments;
return this.each(function(){for(var i=0,length=args.length;
i<length;
i++){jQuery(args[i])[original](this)
}})
}
});
jQuery.each({removeAttr:function(name){jQuery.attr(this,name,"");
if(this.nodeType==1){this.removeAttribute(name)
}},addClass:function(classNames){jQuery.className.add(this,classNames)
},removeClass:function(classNames){jQuery.className.remove(this,classNames)
},toggleClass:function(classNames,state){if(typeof state!=="boolean"){state=!jQuery.className.has(this,classNames)
}jQuery.className[state?"add":"remove"](this,classNames)
},remove:function(selector){if(!selector||jQuery.filter(selector,[this]).length){jQuery("*",this).add([this]).each(function(){jQuery.event.remove(this);
jQuery.removeData(this)
});
if(this.parentNode){this.parentNode.removeChild(this)
}}},empty:function(){jQuery(">*",this).remove();
while(this.firstChild){this.removeChild(this.firstChild)
}}},function(name,fn){jQuery.fn[name]=function(){return this.each(fn,arguments)
}
});
function num(elem,prop){return elem[0]&&parseInt(jQuery.curCSS(elem[0],prop,true),10)||0
}var expando="jQuery"+now(),uuid=0,windowData={};
jQuery.extend({cache:{},data:function(elem,name,data){elem=elem==window?windowData:elem;
var id=elem[expando];
if(!id){id=elem[expando]=++uuid
}if(name&&!jQuery.cache[id]){jQuery.cache[id]={}
}if(data!==undefined){jQuery.cache[id][name]=data
}return name?jQuery.cache[id][name]:id
},removeData:function(elem,name){elem=elem==window?windowData:elem;
var id=elem[expando];
if(name){if(jQuery.cache[id]){delete jQuery.cache[id][name];
name="";
for(name in jQuery.cache[id]){break
}if(!name){jQuery.removeData(elem)
}}}else{try{delete elem[expando]
}catch(e){if(elem.removeAttribute){elem.removeAttribute(expando)
}}delete jQuery.cache[id]
}},queue:function(elem,type,data){if(elem){type=(type||"fx")+"queue";
var q=jQuery.data(elem,type);
if(!q||jQuery.isArray(data)){q=jQuery.data(elem,type,jQuery.makeArray(data))
}else{if(data){q.push(data)
}}}return q
},dequeue:function(elem,type){var queue=jQuery.queue(elem,type),fn=queue.shift();
if(!type||type==="fx"){fn=queue[0]
}if(fn!==undefined){fn.call(elem)
}}});
jQuery.fn.extend({data:function(key,value){var parts=key.split(".");
parts[1]=parts[1]?"."+parts[1]:"";
if(value===undefined){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);
if(data===undefined&&this.length){data=jQuery.data(this[0],key)
}return data===undefined&&parts[1]?this.data(parts[0]):data
}else{return this.trigger("setData"+parts[1]+"!",[parts[0],value]).each(function(){jQuery.data(this,key,value)
})
}},removeData:function(key){return this.each(function(){jQuery.removeData(this,key)
})
},queue:function(type,data){if(typeof type!=="string"){data=type;
type="fx"
}if(data===undefined){return jQuery.queue(this[0],type)
}return this.each(function(){var queue=jQuery.queue(this,type,data);
if(type=="fx"&&queue.length==1){queue[0].call(this)
}})
},dequeue:function(type){return this.each(function(){jQuery.dequeue(this,type)
})
}});
/*
 * Sizzle CSS Selector Engine - v0.9.3
 *  Copyright 2009, The Dojo Foundation
 *  Released under the MIT, BSD, and GPL Licenses.
 *  More information: http://sizzlejs.com/
 */
(function(){var chunker=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]+['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[]+)+|[>+~])(\s*,\s*)?/g,done=0,toString=Object.prototype.toString;
var Sizzle=function(selector,context,results,seed){results=results||[];
context=context||document;
if(context.nodeType!==1&&context.nodeType!==9){return[]
}if(!selector||typeof selector!=="string"){return results
}var parts=[],m,set,checkSet,check,mode,extra,prune=true;
chunker.lastIndex=0;
while((m=chunker.exec(selector))!==null){parts.push(m[1]);
if(m[2]){extra=RegExp.rightContext;
break
}}if(parts.length>1&&origPOS.exec(selector)){if(parts.length===2&&Expr.relative[parts[0]]){set=posProcess(parts[0]+parts[1],context)
}else{set=Expr.relative[parts[0]]?[context]:Sizzle(parts.shift(),context);
while(parts.length){selector=parts.shift();
if(Expr.relative[selector]){selector+=parts.shift()
}set=posProcess(selector,set)
}}}else{var ret=seed?{expr:parts.pop(),set:makeArray(seed)}:Sizzle.find(parts.pop(),parts.length===1&&context.parentNode?context.parentNode:context,isXML(context));
set=Sizzle.filter(ret.expr,ret.set);
if(parts.length>0){checkSet=makeArray(set)
}else{prune=false
}while(parts.length){var cur=parts.pop(),pop=cur;
if(!Expr.relative[cur]){cur=""
}else{pop=parts.pop()
}if(pop==null){pop=context
}Expr.relative[cur](checkSet,pop,isXML(context))
}}if(!checkSet){checkSet=set
}if(!checkSet){throw"Syntax error, unrecognized expression: "+(cur||selector)
}if(toString.call(checkSet)==="[object Array]"){if(!prune){results.push.apply(results,checkSet)
}else{if(context.nodeType===1){for(var i=0;
checkSet[i]!=null;
i++){if(checkSet[i]&&(checkSet[i]===true||checkSet[i].nodeType===1&&contains(context,checkSet[i]))){results.push(set[i])
}}}else{for(var i=0;
checkSet[i]!=null;
i++){if(checkSet[i]&&checkSet[i].nodeType===1){results.push(set[i])
}}}}}else{makeArray(checkSet,results)
}if(extra){Sizzle(extra,context,results,seed)
}return results
};
Sizzle.matches=function(expr,set){return Sizzle(expr,null,null,set)
};
Sizzle.find=function(expr,context,isXML){var set,match;
if(!expr){return[]
}for(var i=0,l=Expr.order.length;
i<l;
i++){var type=Expr.order[i],match;
if((match=Expr.match[type].exec(expr))){var left=RegExp.leftContext;
if(left.substr(left.length-1)!=="\\"){match[1]=(match[1]||"").replace(/\\/g,"");
set=Expr.find[type](match,context,isXML);
if(set!=null){expr=expr.replace(Expr.match[type],"");
break
}}}}if(!set){set=context.getElementsByTagName("*")
}return{set:set,expr:expr}
};
Sizzle.filter=function(expr,set,inplace,not){var old=expr,result=[],curLoop=set,match,anyFound;
while(expr&&set.length){for(var type in Expr.filter){if((match=Expr.match[type].exec(expr))!=null){var filter=Expr.filter[type],found,item;
anyFound=false;
if(curLoop==result){result=[]
}if(Expr.preFilter[type]){match=Expr.preFilter[type](match,curLoop,inplace,result,not);
if(!match){anyFound=found=true
}else{if(match===true){continue
}}}if(match){for(var i=0;
(item=curLoop[i])!=null;
i++){if(item){found=filter(item,match,i,curLoop);
var pass=not^!!found;
if(inplace&&found!=null){if(pass){anyFound=true
}else{curLoop[i]=false
}}else{if(pass){result.push(item);
anyFound=true
}}}}}if(found!==undefined){if(!inplace){curLoop=result
}expr=expr.replace(Expr.match[type],"");
if(!anyFound){return[]
}break
}}}expr=expr.replace(/\s*,\s*/,"");
if(expr==old){if(anyFound==null){throw"Syntax error, unrecognized expression: "+expr
}else{break
}}old=expr
}return curLoop
};
var Expr=Sizzle.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(elem){return elem.getAttribute("href")
}},relative:{"+":function(checkSet,part){for(var i=0,l=checkSet.length;
i<l;
i++){var elem=checkSet[i];
if(elem){var cur=elem.previousSibling;
while(cur&&cur.nodeType!==1){cur=cur.previousSibling
}checkSet[i]=typeof part==="string"?cur||false:cur===part
}}if(typeof part==="string"){Sizzle.filter(part,checkSet,true)
}},">":function(checkSet,part,isXML){if(typeof part==="string"&&!/\W/.test(part)){part=isXML?part:part.toUpperCase();
for(var i=0,l=checkSet.length;
i<l;
i++){var elem=checkSet[i];
if(elem){var parent=elem.parentNode;
checkSet[i]=parent.nodeName===part?parent:false
}}}else{for(var i=0,l=checkSet.length;
i<l;
i++){var elem=checkSet[i];
if(elem){checkSet[i]=typeof part==="string"?elem.parentNode:elem.parentNode===part
}}if(typeof part==="string"){Sizzle.filter(part,checkSet,true)
}}},"":function(checkSet,part,isXML){var doneName="done"+(done++),checkFn=dirCheck;
if(!part.match(/\W/)){var nodeCheck=part=isXML?part:part.toUpperCase();
checkFn=dirNodeCheck
}checkFn("parentNode",part,doneName,checkSet,nodeCheck,isXML)
},"~":function(checkSet,part,isXML){var doneName="done"+(done++),checkFn=dirCheck;
if(typeof part==="string"&&!part.match(/\W/)){var nodeCheck=part=isXML?part:part.toUpperCase();
checkFn=dirNodeCheck
}checkFn("previousSibling",part,doneName,checkSet,nodeCheck,isXML)
}},find:{ID:function(match,context,isXML){if(typeof context.getElementById!=="undefined"&&!isXML){var m=context.getElementById(match[1]);
return m?[m]:[]
}},NAME:function(match,context,isXML){if(typeof context.getElementsByName!=="undefined"&&!isXML){return context.getElementsByName(match[1])
}},TAG:function(match,context){return context.getElementsByTagName(match[1])
}},preFilter:{CLASS:function(match,curLoop,inplace,result,not){match=" "+match[1].replace(/\\/g,"")+" ";
var elem;
for(var i=0;
(elem=curLoop[i])!=null;
i++){if(elem){if(not^(" "+elem.className+" ").indexOf(match)>=0){if(!inplace){result.push(elem)
}}else{if(inplace){curLoop[i]=false
}}}}return false
},ID:function(match){return match[1].replace(/\\/g,"")
},TAG:function(match,curLoop){for(var i=0;
curLoop[i]===false;
i++){}return curLoop[i]&&isXML(curLoop[i])?match[1]:match[1].toUpperCase()
},CHILD:function(match){if(match[1]=="nth"){var test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(match[2]=="even"&&"2n"||match[2]=="odd"&&"2n+1"||!/\D/.test(match[2])&&"0n+"+match[2]||match[2]);
match[2]=(test[1]+(test[2]||1))-0;
match[3]=test[3]-0
}match[0]="done"+(done++);
return match
},ATTR:function(match){var name=match[1].replace(/\\/g,"");
if(Expr.attrMap[name]){match[1]=Expr.attrMap[name]
}if(match[2]==="~="){match[4]=" "+match[4]+" "
}return match
},PSEUDO:function(match,curLoop,inplace,result,not){if(match[1]==="not"){if(match[3].match(chunker).length>1){match[3]=Sizzle(match[3],null,null,curLoop)
}else{var ret=Sizzle.filter(match[3],curLoop,inplace,true^not);
if(!inplace){result.push.apply(result,ret)
}return false
}}else{if(Expr.match.POS.test(match[0])){return true
}}return match
},POS:function(match){match.unshift(true);
return match
}},filters:{enabled:function(elem){return elem.disabled===false&&elem.type!=="hidden"
},disabled:function(elem){return elem.disabled===true
},checked:function(elem){return elem.checked===true
},selected:function(elem){elem.parentNode.selectedIndex;
return elem.selected===true
},parent:function(elem){return !!elem.firstChild
},empty:function(elem){return !elem.firstChild
},has:function(elem,i,match){return !!Sizzle(match[3],elem).length
},header:function(elem){return/h\d/i.test(elem.nodeName)
},text:function(elem){return"text"===elem.type
},radio:function(elem){return"radio"===elem.type
},checkbox:function(elem){return"checkbox"===elem.type
},file:function(elem){return"file"===elem.type
},password:function(elem){return"password"===elem.type
},submit:function(elem){return"submit"===elem.type
},image:function(elem){return"image"===elem.type
},reset:function(elem){return"reset"===elem.type
},button:function(elem){return"button"===elem.type||elem.nodeName.toUpperCase()==="BUTTON"
},input:function(elem){return/input|select|textarea|button/i.test(elem.nodeName)
}},setFilters:{first:function(elem,i){return i===0
},last:function(elem,i,match,array){return i===array.length-1
},even:function(elem,i){return i%2===0
},odd:function(elem,i){return i%2===1
},lt:function(elem,i,match){return i<match[3]-0
},gt:function(elem,i,match){return i>match[3]-0
},nth:function(elem,i,match){return match[3]-0==i
},eq:function(elem,i,match){return match[3]-0==i
}},filter:{CHILD:function(elem,match){var type=match[1],parent=elem.parentNode;
var doneName=match[0];
if(parent&&(!parent[doneName]||!elem.nodeIndex)){var count=1;
for(var node=parent.firstChild;
node;
node=node.nextSibling){if(node.nodeType==1){node.nodeIndex=count++
}}parent[doneName]=count-1
}if(type=="first"){return elem.nodeIndex==1
}else{if(type=="last"){return elem.nodeIndex==parent[doneName]
}else{if(type=="only"){return parent[doneName]==1
}else{if(type=="nth"){var add=false,first=match[2],last=match[3];
if(first==1&&last==0){return true
}if(first==0){if(elem.nodeIndex==last){add=true
}}else{if((elem.nodeIndex-last)%first==0&&(elem.nodeIndex-last)/first>=0){add=true
}}return add
}}}}},PSEUDO:function(elem,match,i,array){var name=match[1],filter=Expr.filters[name];
if(filter){return filter(elem,i,match,array)
}else{if(name==="contains"){return(elem.textContent||elem.innerText||"").indexOf(match[3])>=0
}else{if(name==="not"){var not=match[3];
for(var i=0,l=not.length;
i<l;
i++){if(not[i]===elem){return false
}}return true
}}}},ID:function(elem,match){return elem.nodeType===1&&elem.getAttribute("id")===match
},TAG:function(elem,match){return(match==="*"&&elem.nodeType===1)||elem.nodeName===match
},CLASS:function(elem,match){return match.test(elem.className)
},ATTR:function(elem,match){var result=Expr.attrHandle[match[1]]?Expr.attrHandle[match[1]](elem):elem[match[1]]||elem.getAttribute(match[1]),value=result+"",type=match[2],check=match[4];
return result==null?type==="!=":type==="="?value===check:type==="*="?value.indexOf(check)>=0:type==="~="?(" "+value+" ").indexOf(check)>=0:!match[4]?result:type==="!="?value!=check:type==="^="?value.indexOf(check)===0:type==="$="?value.substr(value.length-check.length)===check:type==="|="?value===check||value.substr(0,check.length+1)===check+"-":false
},POS:function(elem,match,i,array){var name=match[2],filter=Expr.setFilters[name];
if(filter){return filter(elem,i,match,array)
}}}};
var origPOS=Expr.match.POS;
for(var type in Expr.match){Expr.match[type]=RegExp(Expr.match[type].source+/(?![^\[]*\])(?![^\(]*\))/.source)
}var makeArray=function(array,results){array=Array.prototype.slice.call(array);
if(results){results.push.apply(results,array);
return results
}return array
};
try{Array.prototype.slice.call(document.documentElement.childNodes)
}catch(e){makeArray=function(array,results){var ret=results||[];
if(toString.call(array)==="[object Array]"){Array.prototype.push.apply(ret,array)
}else{if(typeof array.length==="number"){for(var i=0,l=array.length;
i<l;
i++){ret.push(array[i])
}}else{for(var i=0;
array[i];
i++){ret.push(array[i])
}}}return ret
}
}(function(){var form=document.createElement("form"),id="script"+(new Date).getTime();
form.innerHTML="<input name='"+id+"'/>";
var root=document.documentElement;
root.insertBefore(form,root.firstChild);
if(!!document.getElementById(id)){Expr.find.ID=function(match,context,isXML){if(typeof context.getElementById!=="undefined"&&!isXML){var m=context.getElementById(match[1]);
return m?m.id===match[1]||typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id").nodeValue===match[1]?[m]:undefined:[]
}};
Expr.filter.ID=function(elem,match){var node=typeof elem.getAttributeNode!=="undefined"&&elem.getAttributeNode("id");
return elem.nodeType===1&&node&&node.nodeValue===match
}
}root.removeChild(form)
})();
(function(){var div=document.createElement("div");
div.appendChild(document.createComment(""));
if(div.getElementsByTagName("*").length>0){Expr.find.TAG=function(match,context){var results=context.getElementsByTagName(match[1]);
if(match[1]==="*"){var tmp=[];
for(var i=0;
results[i];
i++){if(results[i].nodeType===1){tmp.push(results[i])
}}results=tmp
}return results
}
}div.innerHTML="<a href='#'></a>";
if(div.firstChild&&div.firstChild.getAttribute("href")!=="#"){Expr.attrHandle.href=function(elem){return elem.getAttribute("href",2)
}
}})();
if(document.querySelectorAll){(function(){var oldSizzle=Sizzle,div=document.createElement("div");
div.innerHTML="<p class='TEST'></p>";
if(div.querySelectorAll&&div.querySelectorAll(".TEST").length===0){return 
}Sizzle=function(query,context,extra,seed){context=context||document;
if(!seed&&context.nodeType===9&&!isXML(context)){try{return makeArray(context.querySelectorAll(query),extra)
}catch(e){}}return oldSizzle(query,context,extra,seed)
};
Sizzle.find=oldSizzle.find;
Sizzle.filter=oldSizzle.filter;
Sizzle.selectors=oldSizzle.selectors;
Sizzle.matches=oldSizzle.matches
})()
}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){Expr.order.splice(1,0,"CLASS");
Expr.find.CLASS=function(match,context){return context.getElementsByClassName(match[1])
}
}function dirNodeCheck(dir,cur,doneName,checkSet,nodeCheck,isXML){for(var i=0,l=checkSet.length;
i<l;
i++){var elem=checkSet[i];
if(elem){elem=elem[dir];
var match=false;
while(elem&&elem.nodeType){var done=elem[doneName];
if(done){match=checkSet[done];
break
}if(elem.nodeType===1&&!isXML){elem[doneName]=i
}if(elem.nodeName===cur){match=elem;
break
}elem=elem[dir]
}checkSet[i]=match
}}}function dirCheck(dir,cur,doneName,checkSet,nodeCheck,isXML){for(var i=0,l=checkSet.length;
i<l;
i++){var elem=checkSet[i];
if(elem){elem=elem[dir];
var match=false;
while(elem&&elem.nodeType){if(elem[doneName]){match=checkSet[elem[doneName]];
break
}if(elem.nodeType===1){if(!isXML){elem[doneName]=i
}if(typeof cur!=="string"){if(elem===cur){match=true;
break
}}else{if(Sizzle.filter(cur,[elem]).length>0){match=elem;
break
}}}elem=elem[dir]
}checkSet[i]=match
}}}var contains=document.compareDocumentPosition?function(a,b){return a.compareDocumentPosition(b)&16
}:function(a,b){return a!==b&&(a.contains?a.contains(b):true)
};
var isXML=function(elem){return elem.nodeType===9&&elem.documentElement.nodeName!=="HTML"||!!elem.ownerDocument&&isXML(elem.ownerDocument)
};
var posProcess=function(selector,context){var tmpSet=[],later="",match,root=context.nodeType?[context]:context;
while((match=Expr.match.PSEUDO.exec(selector))){later+=match[0];
selector=selector.replace(Expr.match.PSEUDO,"")
}selector=Expr.relative[selector]?selector+"*":selector;
for(var i=0,l=root.length;
i<l;
i++){Sizzle(selector,root[i],tmpSet)
}return Sizzle.filter(later,tmpSet)
};
jQuery.find=Sizzle;
jQuery.filter=Sizzle.filter;
jQuery.expr=Sizzle.selectors;
jQuery.expr[":"]=jQuery.expr.filters;
Sizzle.selectors.filters.hidden=function(elem){return"hidden"===elem.type||jQuery.css(elem,"display")==="none"||jQuery.css(elem,"visibility")==="hidden"
};
Sizzle.selectors.filters.visible=function(elem){return"hidden"!==elem.type&&jQuery.css(elem,"display")!=="none"&&jQuery.css(elem,"visibility")!=="hidden"
};
Sizzle.selectors.filters.animated=function(elem){return jQuery.grep(jQuery.timers,function(fn){return elem===fn.elem
}).length
};
jQuery.multiFilter=function(expr,elems,not){if(not){expr=":not("+expr+")"
}return Sizzle.matches(expr,elems)
};
jQuery.dir=function(elem,dir){var matched=[],cur=elem[dir];
while(cur&&cur!=document){if(cur.nodeType==1){matched.push(cur)
}cur=cur[dir]
}return matched
};
jQuery.nth=function(cur,result,dir,elem){result=result||1;
var num=0;
for(;
cur;
cur=cur[dir]){if(cur.nodeType==1&&++num==result){break
}}return cur
};
jQuery.sibling=function(n,elem){var r=[];
for(;
n;
n=n.nextSibling){if(n.nodeType==1&&n!=elem){r.push(n)
}}return r
};
return ;
window.Sizzle=Sizzle
})();
jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType==3||elem.nodeType==8){return 
}if(elem.setInterval&&elem!=window){elem=window
}if(!handler.guid){handler.guid=this.guid++
}if(data!==undefined){var fn=handler;
handler=this.proxy(fn);
handler.data=data
}var events=jQuery.data(elem,"events")||jQuery.data(elem,"events",{}),handle=jQuery.data(elem,"handle")||jQuery.data(elem,"handle",function(){return typeof jQuery!=="undefined"&&!jQuery.event.triggered?jQuery.event.handle.apply(arguments.callee.elem,arguments):undefined
});
handle.elem=elem;
jQuery.each(types.split(/\s+/),function(index,type){var namespaces=type.split(".");
type=namespaces.shift();
handler.type=namespaces.slice().sort().join(".");
var handlers=events[type];
if(jQuery.event.specialAll[type]){jQuery.event.specialAll[type].setup.call(elem,data,namespaces)
}if(!handlers){handlers=events[type]={};
if(!jQuery.event.special[type]||jQuery.event.special[type].setup.call(elem,data,namespaces)===false){if(elem.addEventListener){elem.addEventListener(type,handle,false)
}else{if(elem.attachEvent){elem.attachEvent("on"+type,handle)
}}}}handlers[handler.guid]=handler;
jQuery.event.global[type]=true
});
elem=null
},guid:1,global:{},remove:function(elem,types,handler){if(elem.nodeType==3||elem.nodeType==8){return 
}var events=jQuery.data(elem,"events"),ret,index;
if(events){if(types===undefined||(typeof types==="string"&&types.charAt(0)==".")){for(var type in events){this.remove(elem,type+(types||""))
}}else{if(types.type){handler=types.handler;
types=types.type
}jQuery.each(types.split(/\s+/),function(index,type){var namespaces=type.split(".");
type=namespaces.shift();
var namespace=RegExp("(^|\\.)"+namespaces.slice().sort().join(".*\\.")+"(\\.|$)");
if(events[type]){if(handler){delete events[type][handler.guid]
}else{for(var handle in events[type]){if(namespace.test(events[type][handle].type)){delete events[type][handle]
}}}if(jQuery.event.specialAll[type]){jQuery.event.specialAll[type].teardown.call(elem,namespaces)
}for(ret in events[type]){break
}if(!ret){if(!jQuery.event.special[type]||jQuery.event.special[type].teardown.call(elem,namespaces)===false){if(elem.removeEventListener){elem.removeEventListener(type,jQuery.data(elem,"handle"),false)
}else{if(elem.detachEvent){elem.detachEvent("on"+type,jQuery.data(elem,"handle"))
}}}ret=null;
delete events[type]
}}})
}for(ret in events){break
}if(!ret){var handle=jQuery.data(elem,"handle");
if(handle){handle.elem=null
}jQuery.removeData(elem,"events");
jQuery.removeData(elem,"handle")
}}},trigger:function(event,data,elem,bubbling){var type=event.type||event;
if(!bubbling){event=typeof event==="object"?event[expando]?event:jQuery.extend(jQuery.Event(type),event):jQuery.Event(type);
if(type.indexOf("!")>=0){event.type=type=type.slice(0,-1);
event.exclusive=true
}if(!elem){event.stopPropagation();
if(this.global[type]){jQuery.each(jQuery.cache,function(){if(this.events&&this.events[type]){jQuery.event.trigger(event,data,this.handle.elem)
}})
}}if(!elem||elem.nodeType==3||elem.nodeType==8){return undefined
}event.result=undefined;
event.target=elem;
data=jQuery.makeArray(data);
data.unshift(event)
}event.currentTarget=elem;
var handle=jQuery.data(elem,"handle");
if(handle){handle.apply(elem,data)
}if((!elem[type]||(jQuery.nodeName(elem,"a")&&type=="click"))&&elem["on"+type]&&elem["on"+type].apply(elem,data)===false){event.result=false
}if(!bubbling&&elem[type]&&!event.isDefaultPrevented()&&!(jQuery.nodeName(elem,"a")&&type=="click")){this.triggered=true;
try{elem[type]()
}catch(e){}}this.triggered=false;
if(!event.isPropagationStopped()){var parent=elem.parentNode||elem.ownerDocument;
if(parent){jQuery.event.trigger(event,data,parent,true)
}}},handle:function(event){var all,handlers;
event=arguments[0]=jQuery.event.fix(event||window.event);
var namespaces=event.type.split(".");
event.type=namespaces.shift();
all=!namespaces.length&&!event.exclusive;
var namespace=RegExp("(^|\\.)"+namespaces.slice().sort().join(".*\\.")+"(\\.|$)");
handlers=(jQuery.data(this,"events")||{})[event.type];
for(var j in handlers){var handler=handlers[j];
if(all||namespace.test(handler.type)){event.handler=handler;
event.data=handler.data;
var ret=handler.apply(this,arguments);
if(ret!==undefined){event.result=ret;
if(ret===false){event.preventDefault();
event.stopPropagation()
}}if(event.isImmediatePropagationStopped()){break
}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(event){if(event[expando]){return event
}var originalEvent=event;
event=jQuery.Event(originalEvent);
for(var i=this.props.length,prop;
i;
){prop=this.props[--i];
event[prop]=originalEvent[prop]
}if(!event.target){event.target=event.srcElement||document
}if(event.target.nodeType==3){event.target=event.target.parentNode
}if(!event.relatedTarget&&event.fromElement){event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement
}if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;
event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc.clientLeft||0);
event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc.clientTop||0)
}if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode)){event.which=event.charCode||event.keyCode
}if(!event.metaKey&&event.ctrlKey){event.metaKey=event.ctrlKey
}if(!event.which&&event.button){event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)))
}return event
},proxy:function(fn,proxy){proxy=proxy||function(){return fn.apply(this,arguments)
};
proxy.guid=fn.guid=fn.guid||proxy.guid||this.guid++;
return proxy
},special:{ready:{setup:bindReady,teardown:function(){}}},specialAll:{live:{setup:function(selector,namespaces){jQuery.event.add(this,namespaces[0],liveHandler)
},teardown:function(namespaces){if(namespaces.length){var remove=0,name=RegExp("(^|\\.)"+namespaces[0]+"(\\.|$)");
jQuery.each((jQuery.data(this,"events").live||{}),function(){if(name.test(this.type)){remove++
}});
if(remove<1){jQuery.event.remove(this,namespaces[0],liveHandler)
}}}}}};
jQuery.Event=function(src){if(!this.preventDefault){return new jQuery.Event(src)
}if(src&&src.type){this.originalEvent=src;
this.type=src.type
}else{this.type=src
}this.timeStamp=now();
this[expando]=true
};
function returnFalse(){return false
}function returnTrue(){return true
}jQuery.Event.prototype={preventDefault:function(){this.isDefaultPrevented=returnTrue;
var e=this.originalEvent;
if(!e){return 
}if(e.preventDefault){e.preventDefault()
}e.returnValue=false
},stopPropagation:function(){this.isPropagationStopped=returnTrue;
var e=this.originalEvent;
if(!e){return 
}if(e.stopPropagation){e.stopPropagation()
}e.cancelBubble=true
},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=returnTrue;
this.stopPropagation()
},isDefaultPrevented:returnFalse,isPropagationStopped:returnFalse,isImmediatePropagationStopped:returnFalse};
var withinElement=function(event){var parent=event.relatedTarget;
while(parent&&parent!=this){try{parent=parent.parentNode
}catch(e){parent=this
}}if(parent!=this){event.type=event.data;
jQuery.event.handle.apply(this,arguments)
}};
jQuery.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(orig,fix){jQuery.event.special[fix]={setup:function(){jQuery.event.add(this,orig,withinElement,fix)
},teardown:function(){jQuery.event.remove(this,orig,withinElement)
}}
});
jQuery.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data)
})
},one:function(type,data,fn){var one=jQuery.event.proxy(fn||data,function(event){jQuery(this).unbind(event,one);
return(fn||data).apply(this,arguments)
});
return this.each(function(){jQuery.event.add(this,type,one,fn&&data)
})
},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn)
})
},trigger:function(type,data){return this.each(function(){jQuery.event.trigger(type,data,this)
})
},triggerHandler:function(type,data){if(this[0]){var event=jQuery.Event(type);
event.preventDefault();
event.stopPropagation();
jQuery.event.trigger(event,data,this[0]);
return event.result
}},toggle:function(fn){var args=arguments,i=1;
while(i<args.length){jQuery.event.proxy(fn,args[i++])
}return this.click(jQuery.event.proxy(fn,function(event){this.lastToggle=(this.lastToggle||0)%i;
event.preventDefault();
return args[this.lastToggle++].apply(this,arguments)||false
}))
},hover:function(fnOver,fnOut){return this.mouseenter(fnOver).mouseleave(fnOut)
},ready:function(fn){bindReady();
if(jQuery.isReady){fn.call(document,jQuery)
}else{jQuery.readyList.push(fn)
}return this
},live:function(type,fn){var proxy=jQuery.event.proxy(fn);
proxy.guid+=this.selector+type;
jQuery(document).bind(liveConvert(type,this.selector),this.selector,proxy);
return this
},die:function(type,fn){jQuery(document).unbind(liveConvert(type,this.selector),fn?{guid:fn.guid+this.selector+type}:null);
return this
}});
function liveHandler(event){var check=RegExp("(^|\\.)"+event.type+"(\\.|$)"),stop=true,elems=[];
jQuery.each(jQuery.data(this,"events").live||[],function(i,fn){if(check.test(fn.type)){var elem=jQuery(event.target).closest(fn.data)[0];
if(elem){elems.push({elem:elem,fn:fn})
}}});
jQuery.each(elems,function(){if(this.fn.call(this.elem,event,this.fn.data)===false){stop=false
}});
return stop
}function liveConvert(type,selector){return["live",type,selector.replace(/\./g,"`").replace(/ /g,"|")].join(".")
}jQuery.extend({isReady:false,readyList:[],ready:function(){if(!jQuery.isReady){jQuery.isReady=true;
if(jQuery.readyList){jQuery.each(jQuery.readyList,function(){this.call(document,jQuery)
});
jQuery.readyList=null
}jQuery(document).triggerHandler("ready")
}}});
var readyBound=false;
function bindReady(){if(readyBound){return 
}readyBound=true;
if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);
jQuery.ready()
},false)
}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);
jQuery.ready()
}});
if(document.documentElement.doScroll&&typeof window.frameElement==="undefined"){(function(){if(jQuery.isReady){return 
}try{document.documentElement.doScroll("left")
}catch(error){setTimeout(arguments.callee,0);
return 
}jQuery.ready()
})()
}}}jQuery.event.add(window,"load",jQuery.ready)
}jQuery.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(i,name){jQuery.fn[name]=function(fn){return fn?this.bind(name,fn):this.trigger(name)
}
});
jQuery(window).bind("unload",function(){for(var id in jQuery.cache){if(id!=1&&jQuery.cache[id].handle){jQuery.event.remove(jQuery.cache[id].handle.elem)
}}});
(function(){jQuery.support={};
var root=document.documentElement,script=document.createElement("script"),div=document.createElement("div"),id="script"+(new Date).getTime();
div.style.display="none";
div.innerHTML='   <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';
var all=div.getElementsByTagName("*"),a=div.getElementsByTagName("a")[0];
if(!all||!all.length||!a){return 
}jQuery.support={leadingWhitespace:div.firstChild.nodeType==3,tbody:!div.getElementsByTagName("tbody").length,objectAll:!!div.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!div.getElementsByTagName("link").length,style:/red/.test(a.getAttribute("style")),hrefNormalized:a.getAttribute("href")==="/a",opacity:a.style.opacity==="0.5",cssFloat:!!a.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};
script.type="text/javascript";
try{script.appendChild(document.createTextNode("window."+id+"=1;"))
}catch(e){}root.insertBefore(script,root.firstChild);
if(window[id]){jQuery.support.scriptEval=true;
delete window[id]
}root.removeChild(script);
if(div.attachEvent&&div.fireEvent){div.attachEvent("onclick",function(){jQuery.support.noCloneEvent=false;
div.detachEvent("onclick",arguments.callee)
});
div.cloneNode(true).fireEvent("onclick")
}jQuery(function(){var div=document.createElement("div");
div.style.width="1px";
div.style.paddingLeft="1px";
document.body.appendChild(div);
jQuery.boxModel=jQuery.support.boxModel=div.offsetWidth===2;
document.body.removeChild(div)
})
})();
var styleFloat=jQuery.support.cssFloat?"cssFloat":"styleFloat";
jQuery.props={"for":"htmlFor","class":"className","float":styleFloat,cssFloat:styleFloat,styleFloat:styleFloat,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};
jQuery.fn.extend({_load:jQuery.fn.load,load:function(url,params,callback){if(typeof url!=="string"){return this._load(url)
}var off=url.indexOf(" ");
if(off>=0){var selector=url.slice(off,url.length);
url=url.slice(0,off)
}var type="GET";
if(params){if(jQuery.isFunction(params)){callback=params;
params=null
}else{if(typeof params==="object"){params=jQuery.param(params);
type="POST"
}}}var self=this;
jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(res,status){if(status=="success"||status=="notmodified"){self.html(selector?jQuery("<div/>").append(res.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(selector):res.responseText)
}if(callback){self.each(callback,[res.responseText,status,res])
}}});
return this
},serialize:function(){return jQuery.param(this.serializeArray())
},serializeArray:function(){return this.map(function(){return this.elements?jQuery.makeArray(this.elements):this
}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type))
}).map(function(i,elem){var val=jQuery(this).val();
return val==null?null:jQuery.isArray(val)?jQuery.map(val,function(val,i){return{name:elem.name,value:val}
}):{name:elem.name,value:val}
}).get()
}});
jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f)
}
});
var jsc=now();
jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;
data=null
}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type})
},getScript:function(url,callback){return jQuery.get(url,null,callback,"script")
},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json")
},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;
data={}
}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type})
},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings)
},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()
},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(s){s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));
var jsonp,jsre=/=\?(&|$)/g,status,data,type=s.type.toUpperCase();
if(s.data&&s.processData&&typeof s.data!=="string"){s.data=jQuery.param(s.data)
}if(s.dataType=="jsonp"){if(type=="GET"){if(!s.url.match(jsre)){s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?"
}}else{if(!s.data||!s.data.match(jsre)){s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?"
}}s.dataType="json"
}if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;
if(s.data){s.data=(s.data+"").replace(jsre,"="+jsonp+"$1")
}s.url=s.url.replace(jsre,"="+jsonp+"$1");
s.dataType="script";
window[jsonp]=function(tmp){data=tmp;
success();
complete();
window[jsonp]=undefined;
try{delete window[jsonp]
}catch(e){}if(head){head.removeChild(script)
}}
}if(s.dataType=="script"&&s.cache==null){s.cache=false
}if(s.cache===false&&type=="GET"){var ts=now();
var ret=s.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+ts+"$2");
s.url=ret+((ret==s.url)?(s.url.match(/\?/)?"&":"?")+"_="+ts:"")
}if(s.data&&type=="GET"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;
s.data=null
}if(s.global&&!jQuery.active++){jQuery.event.trigger("ajaxStart")
}var parts=/^(\w+:)?\/\/([^\/?#]+)/.exec(s.url);
if(s.dataType=="script"&&type=="GET"&&parts&&(parts[1]&&parts[1]!=location.protocol||parts[2]!=location.host)){var head=document.getElementsByTagName("head")[0];
var script=document.createElement("script");
script.src=s.url;
if(s.scriptCharset){script.charset=s.scriptCharset
}if(!jsonp){var done=false;
script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;
success();
complete();
head.removeChild(script)
}}
}head.appendChild(script);
return undefined
}var requestDone=false;
var xhr=s.xhr();
if(s.username){xhr.open(type,s.url,s.async,s.username,s.password)
}else{xhr.open(type,s.url,s.async)
}try{if(s.data){xhr.setRequestHeader("Content-Type",s.contentType)
}if(s.ifModified){xhr.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT")
}xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");
xhr.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default)
}catch(e){}if(s.beforeSend&&s.beforeSend(xhr,s)===false){if(s.global&&!--jQuery.active){jQuery.event.trigger("ajaxStop")
}xhr.abort();
return false
}if(s.global){jQuery.event.trigger("ajaxSend",[xhr,s])
}var onreadystatechange=function(isTimeout){if(xhr.readyState==0){if(ival){clearInterval(ival);
ival=null;
if(s.global&&!--jQuery.active){jQuery.event.trigger("ajaxStop")
}}}else{if(!requestDone&&xhr&&(xhr.readyState==4||isTimeout=="timeout")){requestDone=true;
if(ival){clearInterval(ival);
ival=null
}status=isTimeout=="timeout"?"timeout":!jQuery.httpSuccess(xhr)?"error":s.ifModified&&jQuery.httpNotModified(xhr,s.url)?"notmodified":"success";
if(status=="success"){try{data=jQuery.httpData(xhr,s.dataType,s)
}catch(e){status="parsererror"
}}if(status=="success"){var modRes;
try{modRes=xhr.getResponseHeader("Last-Modified")
}catch(e){}if(s.ifModified&&modRes){jQuery.lastModified[s.url]=modRes
}if(!jsonp){success()
}}else{jQuery.handleError(s,xhr,status)
}complete();
if(isTimeout){xhr.abort()
}if(s.async){xhr=null
}}}};
if(s.async){var ival=setInterval(onreadystatechange,13);
if(s.timeout>0){setTimeout(function(){if(xhr&&!requestDone){onreadystatechange("timeout")
}},s.timeout)
}}try{xhr.send(s.data)
}catch(e){jQuery.handleError(s,xhr,null,e)
}if(!s.async){onreadystatechange()
}function success(){if(s.success){s.success(data,status)
}if(s.global){jQuery.event.trigger("ajaxSuccess",[xhr,s])
}}function complete(){if(s.complete){s.complete(xhr,status)
}if(s.global){jQuery.event.trigger("ajaxComplete",[xhr,s])
}if(s.global&&!--jQuery.active){jQuery.event.trigger("ajaxStop")
}}return xhr
},handleError:function(s,xhr,status,e){if(s.error){s.error(xhr,status,e)
}if(s.global){jQuery.event.trigger("ajaxError",[xhr,s,e])
}},active:0,httpSuccess:function(xhr){try{return !xhr.status&&location.protocol=="file:"||(xhr.status>=200&&xhr.status<300)||xhr.status==304||xhr.status==1223
}catch(e){}return false
},httpNotModified:function(xhr,url){try{var xhrRes=xhr.getResponseHeader("Last-Modified");
return xhr.status==304||xhrRes==jQuery.lastModified[url]
}catch(e){}return false
},httpData:function(xhr,type,s){var ct=xhr.getResponseHeader("content-type"),xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;
if(xml&&data.documentElement.tagName=="parsererror"){throw"parsererror"
}if(s&&s.dataFilter){data=s.dataFilter(data,type)
}if(typeof data==="string"){if(type=="script"){jQuery.globalEval(data)
}if(type=="json"){data=window["eval"]("("+data+")")
}}return data
},param:function(a){var s=[];
function add(key,value){s[s.length]=encodeURIComponent(key)+"="+encodeURIComponent(value)
}if(jQuery.isArray(a)||a.jquery){jQuery.each(a,function(){add(this.name,this.value)
})
}else{for(var j in a){if(jQuery.isArray(a[j])){jQuery.each(a[j],function(){add(j,this)
})
}else{add(j,jQuery.isFunction(a[j])?a[j]():a[j])
}}}return s.join("&").replace(/%20/g,"+")
}});
var elemdisplay={},timerId,fxAttrs=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];
function genFx(type,num){var obj={};
jQuery.each(fxAttrs.concat.apply([],fxAttrs.slice(0,num)),function(){obj[this]=type
});
return obj
}jQuery.fn.extend({show:function(speed,callback){if(speed){return this.animate(genFx("show",3),speed,callback)
}else{for(var i=0,l=this.length;
i<l;
i++){var old=jQuery.data(this[i],"olddisplay");
this[i].style.display=old||"";
if(jQuery.css(this[i],"display")==="none"){var tagName=this[i].tagName,display;
if(elemdisplay[tagName]){display=elemdisplay[tagName]
}else{var elem=jQuery("<"+tagName+" />").appendTo("body");
display=elem.css("display");
if(display==="none"){display="block"
}elem.remove();
elemdisplay[tagName]=display
}this[i].style.display=jQuery.data(this[i],"olddisplay",display)
}}return this
}},hide:function(speed,callback){if(speed){return this.animate(genFx("hide",3),speed,callback)
}else{for(var i=0,l=this.length;
i<l;
i++){var old=jQuery.data(this[i],"olddisplay");
if(!old&&old!=="none"){jQuery.data(this[i],"olddisplay",jQuery.css(this[i],"display"))
}this[i].style.display="none"
}return this
}},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){var bool=typeof fn==="boolean";
return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle.apply(this,arguments):fn==null||bool?this.each(function(){var state=bool?fn:jQuery(this).is(":hidden");
jQuery(this)[state?"show":"hide"]()
}):this.animate(genFx("toggle",3),fn,fn2)
},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback)
},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);
return this[optall.queue===false?"each":"queue"](function(){var opt=jQuery.extend({},optall),p,hidden=this.nodeType==1&&jQuery(this).is(":hidden"),self=this;
for(p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden){return opt.complete.call(this)
}if((p=="height"||p=="width")&&this.style){opt.display=jQuery.css(this,"display");
opt.overflow=this.style.overflow
}}if(opt.overflow!=null){this.style.overflow="hidden"
}opt.curAnim=jQuery.extend({},prop);
jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);
if(/toggle|show|hide/.test(val)){e[val=="toggle"?hidden?"show":"hide":val](prop)
}else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;
if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";
if(unit!="px"){self.style[name]=(end||1)+unit;
start=((end||1)/e.cur(true))*start;
self.style[name]=start+unit
}if(parts[1]){end=((parts[1]=="-="?-1:1)*end)+start
}e.custom(start,end,unit)
}else{e.custom(start,val,"")
}}});
return true
})
},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;
if(clearQueue){this.queue([])
}this.each(function(){for(var i=timers.length-1;
i>=0;
i--){if(timers[i].elem==this){if(gotoEnd){timers[i](true)
}timers.splice(i,1)
}}});
if(!gotoEnd){this.dequeue()
}return this
}});
jQuery.each({slideDown:genFx("show",1),slideUp:genFx("hide",1),slideToggle:genFx("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(name,props){jQuery.fn[name]=function(speed,callback){return this.animate(props,speed,callback)
}
});
jQuery.extend({speed:function(speed,easing,fn){var opt=typeof speed==="object"?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&!jQuery.isFunction(easing)&&easing};
opt.duration=jQuery.fx.off?0:typeof opt.duration==="number"?opt.duration:jQuery.fx.speeds[opt.duration]||jQuery.fx.speeds._default;
opt.old=opt.complete;
opt.complete=function(){if(opt.queue!==false){jQuery(this).dequeue()
}if(jQuery.isFunction(opt.old)){opt.old.call(this)
}};
return opt
},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p
},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum
}},timers:[],fx:function(elem,options,prop){this.options=options;
this.elem=elem;
this.prop=prop;
if(!options.orig){options.orig={}
}}});
jQuery.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)
}(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);
if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"
}},cur:function(force){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]
}var r=parseFloat(jQuery.css(this.elem,this.prop,force));
return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0
},custom:function(from,to,unit){this.startTime=now();
this.start=from;
this.end=to;
this.unit=unit||this.unit||"px";
this.now=this.start;
this.pos=this.state=0;
var self=this;
function t(gotoEnd){return self.step(gotoEnd)
}t.elem=this.elem;
if(t()&&jQuery.timers.push(t)==1){timerId=setInterval(function(){var timers=jQuery.timers;
for(var i=0;
i<timers.length;
i++){if(!timers[i]()){timers.splice(i--,1)
}}if(!timers.length){clearInterval(timerId)
}},13)
}},show:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);
this.options.show=true;
this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());
jQuery(this.elem).show()
},hide:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);
this.options.hide=true;
this.custom(this.cur(),0)
},step:function(gotoEnd){var t=now();
if(gotoEnd||t>=this.options.duration+this.startTime){this.now=this.end;
this.pos=this.state=1;
this.update();
this.options.curAnim[this.prop]=true;
var done=true;
for(var i in this.options.curAnim){if(this.options.curAnim[i]!==true){done=false
}}if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;
this.elem.style.display=this.options.display;
if(jQuery.css(this.elem,"display")=="none"){this.elem.style.display="block"
}}if(this.options.hide){jQuery(this.elem).hide()
}if(this.options.hide||this.options.show){for(var p in this.options.curAnim){jQuery.attr(this.elem.style,p,this.options.orig[p])
}}this.options.complete.call(this.elem)
}return false
}else{var n=t-this.startTime;
this.state=n/this.options.duration;
this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);
this.now=this.start+((this.end-this.start)*this.pos);
this.update()
}return true
}};
jQuery.extend(jQuery.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now)
},_default:function(fx){if(fx.elem.style&&fx.elem.style[fx.prop]!=null){fx.elem.style[fx.prop]=fx.now+fx.unit
}else{fx.elem[fx.prop]=fx.now
}}}});
if(document.documentElement.getBoundingClientRect){jQuery.fn.offset=function(){if(!this[0]){return{top:0,left:0}
}if(this[0]===this[0].ownerDocument.body){return jQuery.offset.bodyOffset(this[0])
}var box=this[0].getBoundingClientRect(),doc=this[0].ownerDocument,body=doc.body,docElem=doc.documentElement,clientTop=docElem.clientTop||body.clientTop||0,clientLeft=docElem.clientLeft||body.clientLeft||0,top=box.top+(self.pageYOffset||jQuery.boxModel&&docElem.scrollTop||body.scrollTop)-clientTop,left=box.left+(self.pageXOffset||jQuery.boxModel&&docElem.scrollLeft||body.scrollLeft)-clientLeft;
return{top:top,left:left}
}
}else{jQuery.fn.offset=function(){if(!this[0]){return{top:0,left:0}
}if(this[0]===this[0].ownerDocument.body){return jQuery.offset.bodyOffset(this[0])
}jQuery.offset.initialized||jQuery.offset.initialize();
var elem=this[0],offsetParent=elem.offsetParent,prevOffsetParent=elem,doc=elem.ownerDocument,computedStyle,docElem=doc.documentElement,body=doc.body,defaultView=doc.defaultView,prevComputedStyle=defaultView.getComputedStyle(elem,null),top=elem.offsetTop,left=elem.offsetLeft;
while((elem=elem.parentNode)&&elem!==body&&elem!==docElem){computedStyle=defaultView.getComputedStyle(elem,null);
top-=elem.scrollTop,left-=elem.scrollLeft;
if(elem===offsetParent){top+=elem.offsetTop,left+=elem.offsetLeft;
if(jQuery.offset.doesNotAddBorder&&!(jQuery.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(elem.tagName))){top+=parseInt(computedStyle.borderTopWidth,10)||0,left+=parseInt(computedStyle.borderLeftWidth,10)||0
}prevOffsetParent=offsetParent,offsetParent=elem.offsetParent
}if(jQuery.offset.subtractsBorderForOverflowNotVisible&&computedStyle.overflow!=="visible"){top+=parseInt(computedStyle.borderTopWidth,10)||0,left+=parseInt(computedStyle.borderLeftWidth,10)||0
}prevComputedStyle=computedStyle
}if(prevComputedStyle.position==="relative"||prevComputedStyle.position==="static"){top+=body.offsetTop,left+=body.offsetLeft
}if(prevComputedStyle.position==="fixed"){top+=Math.max(docElem.scrollTop,body.scrollTop),left+=Math.max(docElem.scrollLeft,body.scrollLeft)
}return{top:top,left:left}
}
}jQuery.offset={initialize:function(){if(this.initialized){return 
}var body=document.body,container=document.createElement("div"),innerDiv,checkDiv,table,td,rules,prop,bodyMarginTop=body.style.marginTop,html='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';
rules={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};
for(prop in rules){container.style[prop]=rules[prop]
}container.innerHTML=html;
body.insertBefore(container,body.firstChild);
innerDiv=container.firstChild,checkDiv=innerDiv.firstChild,td=innerDiv.nextSibling.firstChild.firstChild;
this.doesNotAddBorder=(checkDiv.offsetTop!==5);
this.doesAddBorderForTableAndCells=(td.offsetTop===5);
innerDiv.style.overflow="hidden",innerDiv.style.position="relative";
this.subtractsBorderForOverflowNotVisible=(checkDiv.offsetTop===-5);
body.style.marginTop="1px";
this.doesNotIncludeMarginInBodyOffset=(body.offsetTop===0);
body.style.marginTop=bodyMarginTop;
body.removeChild(container);
this.initialized=true
},bodyOffset:function(body){jQuery.offset.initialized||jQuery.offset.initialize();
var top=body.offsetTop,left=body.offsetLeft;
if(jQuery.offset.doesNotIncludeMarginInBodyOffset){top+=parseInt(jQuery.curCSS(body,"marginTop",true),10)||0,left+=parseInt(jQuery.curCSS(body,"marginLeft",true),10)||0
}return{top:top,left:left}
}};
jQuery.fn.extend({position:function(){var left=0,top=0,results;
if(this[0]){var offsetParent=this.offsetParent(),offset=this.offset(),parentOffset=/^body|html$/i.test(offsetParent[0].tagName)?{top:0,left:0}:offsetParent.offset();
offset.top-=num(this,"marginTop");
offset.left-=num(this,"marginLeft");
parentOffset.top+=num(offsetParent,"borderTopWidth");
parentOffset.left+=num(offsetParent,"borderLeftWidth");
results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left}
}return results
},offsetParent:function(){var offsetParent=this[0].offsetParent||document.body;
while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&jQuery.css(offsetParent,"position")=="static")){offsetParent=offsetParent.offsetParent
}return jQuery(offsetParent)
}});
jQuery.each(["Left","Top"],function(i,name){var method="scroll"+name;
jQuery.fn[method]=function(val){if(!this[0]){return null
}return val!==undefined?this.each(function(){this==window||this==document?window.scrollTo(!i?val:jQuery(window).scrollLeft(),i?val:jQuery(window).scrollTop()):this[method]=val
}):this[0]==window||this[0]==document?self[i?"pageYOffset":"pageXOffset"]||jQuery.boxModel&&document.documentElement[method]||document.body[method]:this[0][method]
}
});
jQuery.each(["Height","Width"],function(i,name){var tl=i?"Left":"Top",br=i?"Right":"Bottom";
jQuery.fn["inner"+name]=function(){return this[name.toLowerCase()]()+num(this,"padding"+tl)+num(this,"padding"+br)
};
jQuery.fn["outer"+name]=function(margin){return this["inner"+name]()+num(this,"border"+tl+"Width")+num(this,"border"+br+"Width")+(margin?num(this,"margin"+tl)+num(this,"margin"+br):0)
};
var type=name.toLowerCase();
jQuery.fn[type]=function(size){return this[0]==window?document.compatMode=="CSS1Compat"&&document.documentElement["client"+name]||document.body["client"+name]:this[0]==document?Math.max(document.documentElement["client"+name],document.body["scroll"+name],document.documentElement["scroll"+name],document.body["offset"+name],document.documentElement["offset"+name]):size===undefined?(this.length?jQuery.css(this[0],type):null):this.css(type,typeof size==="string"?size:size+"px")
}
})
})();/*
 * Autocomplete - jQuery plugin 1.0.2
 *
 * Copyright (c) 2007 Dylan Verheul, Dan G. Switzer, Anjesh Tuladhar, Jörn Zaefferer
 *
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 *
 * Revision: $Id: jquery.autocomplete.js 5747 2008-06-25 18:30:55Z joern.zaefferer $
 *
 * http://docs.jquery.com/Plugins/Autocomplete
 */
(function(A){A.fn.extend({autocomplete:function(B,C){var D=typeof B=="string";
C=A.extend({},A.Autocompleter.defaults,{url:D?B:null,data:D?null:B,delay:D?A.Autocompleter.defaults.delay:10,max:C&&!C.scroll?10:150},C);
C.highlight=C.highlight||function(E){return E
};
C.formatMatch=C.formatMatch||C.formatItem;
return this.each(function(){new A.Autocompleter(this,C)
})
},result:function(B){return this.bind("result",B)
},search:function(B){return this.trigger("search",[B])
},showSelect:function(B){return this.trigger("showSelect",[B])
},hideSelect:function(B){return this.trigger("hideSelect",[B])
},flushCache:function(){return this.trigger("flushCache")
},setOptions:function(B){return this.trigger("setOptions",[B])
},unautocomplete:function(){return this.trigger("unautocomplete")
}});
A.Autocompleter=function(M,H){var C={UP:38,DOWN:40,DEL:46,TAB:9,RETURN:13,ESC:27,COMMA:188,PAGEUP:33,PAGEDOWN:34,BACKSPACE:8};
var B=A(M).attr("autocomplete","off").addClass(H.inputClass);
var K;
var R="";
var N=A.Autocompleter.Cache(H);
var F=0;
var V;
var Y={mouseDownOnSelect:false};
var S=A.Autocompleter.Select(H,M,D,Y);
var X;
var E;
A.browser.opera&&A(M.form).bind("submit.autocomplete",function(){if(X){X=false;
return false
}});
B.bind((A.browser.opera?"keypress":"keydown")+".autocomplete",function(Z){V=Z.keyCode;
switch(Z.keyCode){case C.UP:Z.preventDefault();
if(S.visible()){S.prev()
}else{U(0,true)
}break;
case C.DOWN:Z.preventDefault();
if(S.visible()){S.next()
}else{U(0,true)
}break;
case C.PAGEUP:Z.preventDefault();
if(S.visible()){S.pageUp()
}else{U(0,true)
}break;
case C.PAGEDOWN:Z.preventDefault();
if(S.visible()){S.pageDown()
}else{U(0,true)
}break;
case C.TAB:break;
case H.multiple&&A.trim(H.multipleSeparator)==","&&C.COMMA:case C.RETURN:if(D()){Z.preventDefault();
X=true;
return false
}else{if(H.jumpToUniqueResult){E=true
}}break;
case C.ESC:S.hide();
break;
default:clearTimeout(K);
if(H.hideImmediatelyOnChange){S.hide()
}K=setTimeout(U,H.delay);
break
}}).focus(function(){F++
}).blur(function(){F=0
}).click(function(){if(F++>1&&!S.visible()){U(0,true)
}}).bind("search",function(){var Z=(arguments.length>1)?arguments[1]:null;
function a(e,d){var b;
if(d&&d.length){for(var c=0;
c<d.length;
c++){if(d[c].result.toLowerCase()==e.toLowerCase()){b=d[c];
break
}}}if(typeof Z=="function"){Z(b)
}else{B.trigger("result",b&&[b.data,b.value])
}}A.each(I(B.val()),function(b,c){G(c,a,a)
})
}).bind("flushCache",function(){N.flush()
}).bind("setOptions",function(){A.extend(H,arguments[1]);
if("data" in arguments[1]){N.populate()
}}).bind("unautocomplete",function(){S.unbind();
B.unbind();
A(M.form).unbind(".autocomplete")
}).bind("showSelect",function(){B.focus();
F++;
U(0,true)
}).bind("hideSelect",function(){W()
});
function D(){var a=S.selected();
if(!a){return false
}var Z=H.formatSelection?H.formatSelection(a,R):a.result;
R=Z;
if(H.multiple){var b=I(B.val());
if(b.length>1){Z=b.slice(0,b.length-1).join(H.multipleSeparator)+H.multipleSeparator+Z
}Z+=H.multipleSeparator
}B.val(Z);
W();
B.trigger("result",[a.data,a.value]);
return true
}function U(b,a){if(V==C.DEL){S.hide();
return 
}var Z=B.val();
if(!a&&Z==R){return 
}R=Z;
Z=J(Z);
if(Z.length>=H.minChars){B.addClass(H.loadingClass);
if(!H.matchCase){Z=Z.toLowerCase()
}G(Z,L,W)
}else{O();
S.hide()
}}function I(a){if(!a){return[""]
}var b=a.split(H.multipleSeparator);
var Z=[];
A.each(b,function(c,d){if(A.trim(d)){Z[c]=A.trim(d)
}});
return Z
}function J(Z){if(!H.multiple){return Z
}var a=I(Z);
return a[a.length-1]
}function Q(Z,a){if(H.autoFill&&(J(B.val()).toLowerCase()==Z.toLowerCase())&&V!=C.BACKSPACE){B.val(B.val()+a.substring(J(R).length));
A.Autocompleter.Selection(M,R.length,R.length+a.length)
}}function T(){clearTimeout(K);
K=setTimeout(W,200)
}function W(){var Z=S.visible();
S.hide();
clearTimeout(K);
O();
if(H.mustMatch){B.search(function(a){if(!a){if(H.multiple){var b=I(B.val()).slice(0,-1);
B.val(b.join(H.multipleSeparator)+(b.length?H.multipleSeparator:""))
}else{B.val("")
}}})
}if(Z){A.Autocompleter.Selection(M,M.value.length,M.value.length)
}}function L(a,Z){if(Z&&F&&(Z.length||H.noResultsMessage)){var b;
if(Z.length==0){Z=P(H.noResultsMessage);
b=true
}else{b=false
}O();
S.display(Z,a);
Q(a,Z[0].value);
S.show();
S.noResults(b);
if(!b&&Z.length==1&&E){D()
}}else{W()
}E=false
}function G(a,c,Z){if(!H.matchCase){a=a.toLowerCase()
}var b=N.load(a);
if(b&&b.length){c(a,b)
}else{if((typeof H.url=="string")&&(H.url.length>0)){var d={timestamp:+new Date()};
A.each(H.extraParams,function(e,f){d[e]=typeof f=="function"?f():f
});
A.ajax({mode:"abort",port:"autocomplete"+M.name,dataType:H.dataType,url:H.url,data:A.extend({q:J(a),limit:H.max},d),success:function(f){var e=H.parse&&H.parse(f)||P(f);
N.add(a,e);
c(a,e)
}})
}else{S.emptyList();
Z(a)
}}}function P(c){var Z=[];
var b=c.split("\n");
for(var a=0;
a<b.length;
a++){var d=A.trim(b[a]);
if(d){d=d.split("|");
Z[Z.length]={data:d,value:d[0],result:H.formatResult&&H.formatResult(d,d[0])||d[0]}
}}return Z
}function O(){B.removeClass(H.loadingClass)
}};
A.Autocompleter.defaults={inputClass:"ac_input",resultsClass:"ac_results",loadingClass:"ac_loading",minChars:1,delay:400,matchCase:false,matchSubset:true,matchContains:false,cacheLength:10,max:100,mustMatch:false,extraParams:{},selectFirst:true,formatItem:function(B){return B[0]
},formatMatch:null,autoFill:false,width:0,multiple:false,multipleSeparator:", ",highlight:function(C,B){return C.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+B.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\\$1")+")(?![^<>]*>)(?![^&;]+;)","gi"),"<strong>$1</strong>")
},scroll:true,scrollHeight:180};
A.Autocompleter.Cache=function(C){var F={};
var D=0;
function H(K,J){if(!C.matchCase){K=K.toLowerCase()
}var I=K.indexOf(J);
if(I==-1){return false
}return I==0||C.matchContains
}function G(J,I){if(D>C.cacheLength){B()
}if(!F[J]){D++
}F[J]=I
}function E(){if(!C.data){return false
}var J={},I=0;
if(!C.url){C.cacheLength=1
}J[""]=[];
for(var L=0,K=C.data.length;
L<K;
L++){var O=C.data[L];
O=(typeof O=="string")?[O]:O;
var N=C.formatMatch(O,L+1,C.data.length);
if(N===false){continue
}var M=N.charAt(0).toLowerCase();
if(!J[M]){J[M]=[]
}var P={value:N,data:O,result:C.formatResult&&C.formatResult(O)||N};
J[M].push(P);
if(I++<C.max){J[""].push(P)
}}A.each(J,function(Q,R){C.cacheLength++;
G(Q,R)
})
}setTimeout(E,25);
function B(){F={};
D=0
}return{flush:B,add:G,populate:E,load:function(L){if(!C.cacheLength||!D){return null
}if(!C.url&&C.matchContains){var K=[];
for(var I in F){if(I.length>0){var M=F[I];
A.each(M,function(O,N){if(H(N.value,L)){K.push(N)
}})
}}return K
}else{if(F[L]){return F[L]
}else{if(C.matchSubset){for(var J=L.length-1;
J>=C.minChars;
J--){var M=F[L.substr(0,J)];
if(M){var K=[];
A.each(M,function(O,N){if(H(N.value,L)){K[K.length]=N
}});
return K
}}}}}return null
}}
};
A.Autocompleter.Select=function(E,J,L,P){var I={ACTIVE:"ac_over"};
var K,F=-1,R,M="",S=true,C,O;
function N(){if(!S){return 
}C=A("<div/>").hide().addClass(E.resultsClass).css("position","absolute").appendTo(E.appendTo?E.appendTo:document.body);
O=A("<ul/>").appendTo(C).mouseover(function(T){if(Q(T).nodeName&&Q(T).nodeName.toUpperCase()=="LI"){F=A("li",O).removeClass(I.ACTIVE).index(Q(T));
A(Q(T)).addClass(I.ACTIVE)
}}).click(function(T){A(Q(T)).addClass(I.ACTIVE);
L();
J.focus();
return false
}).mousedown(function(){P.mouseDownOnSelect=true
}).mouseup(function(){P.mouseDownOnSelect=false
});
if(E.width>0){C.css("width",E.width)
}S=false
}function Q(U){var T=U.target;
while(T&&T.tagName!="LI"){T=T.parentNode
}if(!T){return[]
}return T
}function H(T){K.slice(F,F+1).removeClass(I.ACTIVE);
G(T);
var V=K.slice(F,F+1).addClass(I.ACTIVE);
if(E.scroll){var U=0;
K.slice(0,F).each(function(){U+=this.offsetHeight
});
if((U+V[0].offsetHeight-O.scrollTop())>O[0].clientHeight){O.scrollTop(U+V[0].offsetHeight-O.innerHeight())
}else{if(U<O.scrollTop()){O.scrollTop(U)
}}}}function G(T){F+=T;
if(F<0){F=K.size()-1
}else{if(F>=K.size()){F=0
}}}function B(T){return E.max&&E.max<T?E.max:T
}function D(){O.empty();
var U=B(R.length);
for(var W=0;
W<U;
W++){if(!R[W]){continue
}var X=E.formatItem(R[W].data,W+1,U,R[W].value,M);
if(X===false){continue
}var V=A('<a href="#">'+E.highlight(X,M)+"</a>");
V.focus((function(Y){return function(){H(Y-F)
}
})(W));
var T=A("<li/>").append(A("<div></div>").append(V)).addClass(W%2==0?"ac_even":"ac_odd").appendTo(O)[0];
if(W==U-1){A(T).addClass("last")
}A.data(T,"ac_data",R[W])
}K=O.find("li");
if(E.selectFirst){K.slice(0,1).addClass(I.ACTIVE);
F=0
}if(A.fn.bgiframe){O.bgiframe()
}}return{display:function(U,T){N();
R=U;
M=T;
D()
},next:function(){H(1)
},prev:function(){H(-1)
},pageUp:function(){if(F!=0&&F-8<0){H(-F)
}else{H(-8)
}},pageDown:function(){if(F!=K.size()-1&&F+8>K.size()){H(K.size()-1-F)
}else{H(8)
}},hide:function(){C&&C.hide();
K&&K.removeClass(I.ACTIVE);
F=-1
},visible:function(){return C&&C.is(":visible")
},current:function(){return this.visible()&&(K.filter("."+I.ACTIVE)[0]||E.selectFirst&&K[0])
},show:function(){var Y=A(J).offset();
var X=-4;
var T=8;
var W={width:(typeof E.width=="string"||E.width>0?E.width:A(J).width())+(2*X),top:Y.top+J.offsetHeight+T,left:Y.left+X};
C.show();
if(E.scroll){O.scrollTop(0);
O.css({maxHeight:E.scrollHeight,overflow:"auto"});
if(A.browser.msie&&typeof document.body.style.maxHeight==="undefined"){var V=function(){K.each(function(){U+=this.offsetHeight
});
var Z=U>E.scrollHeight;
O.css("height",Z?E.scrollHeight:U);
if(!Z){K.width(O.width()-parseInt(K.css("padding-left"))-parseInt(K.css("padding-right")))
}};
var U=0;
V();
U=0;
setTimeout(V,0)
}}},selected:function(){var T=K&&K.filter("."+I.ACTIVE).removeClass(I.ACTIVE);
return T&&T.length&&A.data(T[0],"ac_data")
},emptyList:function(){O&&O.empty()
},unbind:function(){C&&C.remove()
},noResults:function(T){if(T){O.addClass("noresults")
}else{O.removeClass("noresults")
}}}
};
A.Autocompleter.Selection=function(D,E,C){if(D.createTextRange){var B=D.createTextRange();
B.collapse(true);
B.moveStart("character",E);
B.moveEnd("character",C);
B.select()
}else{if(D.setSelectionRange){D.setSelectionRange(E,C)
}else{if(D.selectionStart){D.selectionStart=E;
D.selectionEnd=C
}}}D.focus()
}
})(jQuery);var OpenLayers={singleFile:true};(function(){var G=(typeof OpenLayers=="object"&&OpenLayers.singleFile);
window.OpenLayers={_scriptName:(!G)?"lib/OpenLayers.js":"OpenLayers.js",_getScriptLocation:function(){var P="";
var Q=OpenLayers._scriptName;
var L=document.getElementsByTagName("script");
for(var N=0,K=L.length;
N<K;
N++){var R=L[N].getAttribute("src");
if(R){var M=R.lastIndexOf(Q);
var O=R.lastIndexOf("?");
if(O<0){O=R.length
}if((M>-1)&&(M+Q.length==O)){P=R.slice(0,O-Q.length);
break
}}}return P
}};
if(!G){var H=new Array("OpenLayers/Util.js","OpenLayers/BaseTypes.js","OpenLayers/BaseTypes/Class.js","OpenLayers/BaseTypes/Bounds.js","OpenLayers/BaseTypes/Element.js","OpenLayers/BaseTypes/LonLat.js","OpenLayers/BaseTypes/Pixel.js","OpenLayers/BaseTypes/Size.js","OpenLayers/Console.js","OpenLayers/Tween.js","Rico/Corner.js","Rico/Color.js","Gears/gears_init.js","OpenLayers/Ajax.js","OpenLayers/Request.js","OpenLayers/Request/XMLHttpRequest.js","OpenLayers/Events.js","OpenLayers/Projection.js","OpenLayers/Map.js","OpenLayers/Layer.js","OpenLayers/Icon.js","OpenLayers/Marker.js","OpenLayers/Marker/Box.js","OpenLayers/Popup.js","OpenLayers/Tile.js","OpenLayers/Tile/Image.js","OpenLayers/Tile/WFS.js","OpenLayers/Layer/Image.js","OpenLayers/Layer/SphericalMercator.js","OpenLayers/Layer/EventPane.js","OpenLayers/Layer/FixedZoomLevels.js","OpenLayers/Layer/Google.js","OpenLayers/Layer/VirtualEarth.js","OpenLayers/Layer/Yahoo.js","OpenLayers/Layer/HTTPRequest.js","OpenLayers/Layer/Grid.js","OpenLayers/Layer/MapGuide.js","OpenLayers/Layer/MapServer.js","OpenLayers/Layer/MapServer/Untiled.js","OpenLayers/Layer/KaMap.js","OpenLayers/Layer/KaMapCache.js","OpenLayers/Layer/MultiMap.js","OpenLayers/Layer/Markers.js","OpenLayers/Layer/Text.js","OpenLayers/Layer/WorldWind.js","OpenLayers/Layer/WMS.js","OpenLayers/Layer/WMS/Untiled.js","OpenLayers/Layer/GeoRSS.js","OpenLayers/Layer/Boxes.js","OpenLayers/Layer/TMS.js","OpenLayers/Layer/TileCache.js","OpenLayers/Popup/Anchored.js","OpenLayers/Popup/AnchoredBubble.js","OpenLayers/Popup/Framed.js","OpenLayers/Popup/FramedCloud.js","OpenLayers/Feature.js","OpenLayers/Feature/Vector.js","OpenLayers/Feature/WFS.js","OpenLayers/Handler.js","OpenLayers/Handler/Click.js","OpenLayers/Handler/Hover.js","OpenLayers/Handler/Point.js","OpenLayers/Handler/Path.js","OpenLayers/Handler/Polygon.js","OpenLayers/Handler/Feature.js","OpenLayers/Handler/Drag.js","OpenLayers/Handler/RegularPolygon.js","OpenLayers/Handler/Box.js","OpenLayers/Handler/MouseWheel.js","OpenLayers/Handler/Keyboard.js","OpenLayers/Control.js","OpenLayers/Control/Attribution.js","OpenLayers/Control/Button.js","OpenLayers/Control/ZoomBox.js","OpenLayers/Control/ZoomToMaxExtent.js","OpenLayers/Control/DragPan.js","OpenLayers/Control/Navigation.js","OpenLayers/Control/MouseDefaults.js","OpenLayers/Control/MousePosition.js","OpenLayers/Control/OverviewMap.js","OpenLayers/Control/KeyboardDefaults.js","OpenLayers/Control/PanZoom.js","OpenLayers/Control/PanZoomBar.js","OpenLayers/Control/ArgParser.js","OpenLayers/Control/Permalink.js","OpenLayers/Control/Scale.js","OpenLayers/Control/ScaleLine.js","OpenLayers/Control/LayerSwitcher.js","OpenLayers/Control/DrawFeature.js","OpenLayers/Control/DragFeature.js","OpenLayers/Control/ModifyFeature.js","OpenLayers/Control/Panel.js","OpenLayers/Control/SelectFeature.js","OpenLayers/Control/NavigationHistory.js","OpenLayers/Control/Measure.js","OpenLayers/Geometry.js","OpenLayers/Geometry/Rectangle.js","OpenLayers/Geometry/Collection.js","OpenLayers/Geometry/Point.js","OpenLayers/Geometry/MultiPoint.js","OpenLayers/Geometry/Curve.js","OpenLayers/Geometry/LineString.js","OpenLayers/Geometry/LinearRing.js","OpenLayers/Geometry/Polygon.js","OpenLayers/Geometry/MultiLineString.js","OpenLayers/Geometry/MultiPolygon.js","OpenLayers/Geometry/Surface.js","OpenLayers/Renderer.js","OpenLayers/Renderer/Elements.js","OpenLayers/Renderer/SVG.js","OpenLayers/Renderer/Canvas.js","OpenLayers/Renderer/VML.js","OpenLayers/Layer/Vector.js","OpenLayers/Strategy.js","OpenLayers/Strategy/Fixed.js","OpenLayers/Strategy/Cluster.js","OpenLayers/Strategy/Paging.js","OpenLayers/Strategy/BBOX.js","OpenLayers/Protocol.js","OpenLayers/Protocol/HTTP.js","OpenLayers/Protocol/SQL.js","OpenLayers/Protocol/SQL/Gears.js","OpenLayers/Layer/PointTrack.js","OpenLayers/Layer/GML.js","OpenLayers/Style.js","OpenLayers/StyleMap.js","OpenLayers/Rule.js","OpenLayers/Filter.js","OpenLayers/Filter/FeatureId.js","OpenLayers/Filter/Logical.js","OpenLayers/Filter/Comparison.js","OpenLayers/Filter/Spatial.js","OpenLayers/Format.js","OpenLayers/Format/XML.js","OpenLayers/Format/GML.js","OpenLayers/Format/GML/Base.js","OpenLayers/Format/GML/v2.js","OpenLayers/Format/GML/v3.js","OpenLayers/Format/KML.js","OpenLayers/Format/GeoRSS.js","OpenLayers/Format/WFS.js","OpenLayers/Format/WKT.js","OpenLayers/Format/OSM.js","OpenLayers/Format/GPX.js","OpenLayers/Format/SLD.js","OpenLayers/Format/SLD/v1.js","OpenLayers/Format/SLD/v1_0_0.js","OpenLayers/Format/SLD/v1.js","OpenLayers/Format/Filter.js","OpenLayers/Format/Filter/v1.js","OpenLayers/Format/Filter/v1_0_0.js","OpenLayers/Format/Text.js","OpenLayers/Format/JSON.js","OpenLayers/Format/GeoJSON.js","OpenLayers/Format/WMC.js","OpenLayers/Format/WMC/v1.js","OpenLayers/Format/WMC/v1_0_0.js","OpenLayers/Format/WMC/v1_1_0.js","OpenLayers/Layer/WFS.js","OpenLayers/Control/MouseToolbar.js","OpenLayers/Control/NavToolbar.js","OpenLayers/Control/PanPanel.js","OpenLayers/Control/Pan.js","OpenLayers/Control/ZoomIn.js","OpenLayers/Control/ZoomOut.js","OpenLayers/Control/ZoomPanel.js","OpenLayers/Control/EditingToolbar.js","OpenLayers/Lang.js","OpenLayers/Lang/en.js");
var B=navigator.userAgent;
var D=(B.match("MSIE")||B.match("Safari"));
if(D){var A=new Array(H.length)
}var I=OpenLayers._getScriptLocation()+"js/lib/";
I="js/lib/";
for(var C=0,F=H.length;
C<F;
C++){if(D){A[C]="<script src='"+I+H[C]+"'><\/script>"
}else{var J=document.createElement("script");
J.src=I+H[C];
var E=document.getElementsByTagName("head").length?document.getElementsByTagName("head")[0]:document.body;
E.appendChild(J)
}}if(D){document.write(A.join(""))
}}})();
OpenLayers.VERSION_NUMBER="$Revision: 8012 $";OpenLayers.Util={};
OpenLayers.Util.getElement=function(){var D=[];
for(var C=0,A=arguments.length;
C<A;
C++){var B=arguments[C];
if(typeof B=="string"){B=document.getElementById(B)
}if(arguments.length==1){return B
}D.push(B)
}return D
};
if($==null){var $=OpenLayers.Util.getElement
}OpenLayers.Util.extend=function(A,E){A=A||{};
if(E){for(var D in E){var C=E[D];
if(C!==undefined){A[D]=C
}}var B=typeof window.Event=="function"&&E instanceof window.Event;
if(!B&&E.hasOwnProperty&&E.hasOwnProperty("toString")){A.toString=E.toString
}}return A
};
OpenLayers.Util.removeItem=function(C,B){for(var A=C.length-1;
A>=0;
A--){if(C[A]==B){C.splice(A,1)
}}return C
};
OpenLayers.Util.clearArray=function(A){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"array = []"}));
A.length=0
};
OpenLayers.Util.indexOf=function(D,C){for(var B=0,A=D.length;
B<A;
B++){if(D[B]==C){return B
}}return -1
};
OpenLayers.Util.modifyDOMElement=function(E,H,D,F,A,C,G,B){if(H){E.id=H
}if(D){E.style.left=D.x+"px";
E.style.top=D.y+"px"
}if(F){E.style.width=F.w+"px";
E.style.height=F.h+"px"
}if(A){E.style.position=A
}if(C){E.style.border=C
}if(G){E.style.overflow=G
}if(parseFloat(B)>=0&&parseFloat(B)<1){E.style.filter="alpha(opacity="+(B*100)+")";
E.style.opacity=B
}else{if(parseFloat(B)==1){E.style.filter="";
E.style.opacity=""
}}};
OpenLayers.Util.createDiv=function(A,I,H,F,E,C,B,G){var D=document.createElement("div");
if(F){D.style.backgroundImage="url("+F+")"
}if(!A){A=OpenLayers.Util.createUniqueID("OpenLayersDiv")
}if(!E){E="absolute"
}OpenLayers.Util.modifyDOMElement(D,A,I,H,E,C,B,G);
return D
};
OpenLayers.Util.createImage=function(A,H,G,E,D,C,F,I){var B=document.createElement("img");
if(!A){A=OpenLayers.Util.createUniqueID("OpenLayersDiv")
}if(!D){D="relative"
}OpenLayers.Util.modifyDOMElement(B,A,H,G,D,C,null,F);
if(I){B.style.display="none";
OpenLayers.Event.observe(B,"load",OpenLayers.Function.bind(OpenLayers.Util.onImageLoad,B));
OpenLayers.Event.observe(B,"error",OpenLayers.Function.bind(OpenLayers.Util.onImageLoadError,B))
}B.style.alt=A;
B.galleryImg="no";
if(E){B.src=E
}return B
};
OpenLayers.Util.setOpacity=function(B,A){OpenLayers.Util.modifyDOMElement(B,null,null,null,null,null,null,A)
};
OpenLayers.Util.onImageLoad=function(){if(!this.viewRequestID||(this.map&&this.viewRequestID==this.map.viewRequestID)){this.style.backgroundColor=null;
this.style.display=""
}};
OpenLayers.Util.onImageLoadErrorColor="pink";
OpenLayers.IMAGE_RELOAD_ATTEMPTS=0;
OpenLayers.Util.onImageLoadError=function(){this._attempts=(this._attempts)?(this._attempts+1):1;
if(this._attempts<=OpenLayers.IMAGE_RELOAD_ATTEMPTS){var D=this.urls;
if(D&&D instanceof Array&&D.length>1){var E=this.src.toString();
var C,A;
for(A=0;
C=D[A];
A++){if(E.indexOf(C)!=-1){break
}}var F=Math.floor(D.length*Math.random());
var B=D[F];
A=0;
while(B==C&&A++<4){F=Math.floor(D.length*Math.random());
B=D[F]
}this.src=E.replace(C,B)
}else{this.src=this.src
}}else{this.style.backgroundColor=OpenLayers.Util.onImageLoadErrorColor
}this.style.display=""
};
OpenLayers.Util.alphaHack=function(){var D=navigator.appVersion.split("MSIE");
var A=parseFloat(D[1]);
var B=false;
try{B=!!(document.body.filters)
}catch(C){}return(B&&(A>=5.5)&&(A<7))
};
OpenLayers.Util.modifyAlphaImageDiv=function(A,B,J,I,G,F,C,D,H){OpenLayers.Util.modifyDOMElement(A,B,J,I,F,null,null,H);
var E=A.childNodes[0];
if(G){E.src=G
}OpenLayers.Util.modifyDOMElement(E,A.id+"_innerImage",null,I,"relative",C);
if(OpenLayers.Util.alphaHack()){if(A.style.display!="none"){A.style.display="inline-block"
}if(D==null){D="scale"
}A.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+E.src+"', sizingMethod='"+D+"')";
if(parseFloat(A.style.opacity)>=0&&parseFloat(A.style.opacity)<1){A.style.filter+=" alpha(opacity="+A.style.opacity*100+")"
}E.style.filter="alpha(opacity=0)"
}};
OpenLayers.Util.createAlphaImageDiv=function(B,J,I,G,F,C,D,H,K){var A=OpenLayers.Util.createDiv();
var E=OpenLayers.Util.createImage(null,null,null,null,null,null,null,false);
A.appendChild(E);
if(K){E.style.display="none";
OpenLayers.Event.observe(E,"load",OpenLayers.Function.bind(OpenLayers.Util.onImageLoad,A));
OpenLayers.Event.observe(E,"error",OpenLayers.Function.bind(OpenLayers.Util.onImageLoadError,A))
}OpenLayers.Util.modifyAlphaImageDiv(A,B,J,I,G,F,C,D,H);
return A
};
OpenLayers.Util.upperCaseObject=function(B){var A={};
for(var C in B){A[C.toUpperCase()]=B[C]
}return A
};
OpenLayers.Util.applyDefaults=function(D,C){D=D||{};
var B=typeof window.Event=="function"&&C instanceof window.Event;
for(var A in C){if(D[A]===undefined||(!B&&C.hasOwnProperty&&C.hasOwnProperty(A)&&!D.hasOwnProperty(A))){D[A]=C[A]
}}if(!B&&C&&C.hasOwnProperty&&C.hasOwnProperty("toString")&&!D.hasOwnProperty("toString")){D.toString=C.toString
}return D
};
OpenLayers.Util.getParameterString=function(H){var G=[];
for(var C in H){var E=H[C];
if((E!=null)&&(typeof E!="function")){var B;
if(typeof E=="object"&&E.constructor==Array){var F=[];
for(var D=0,A=E.length;
D<A;
D++){F.push(encodeURIComponent(E[D]))
}B=F.join(",")
}else{B=encodeURIComponent(E)
}G.push(encodeURIComponent(C)+"="+B)
}}return G.join("&")
};
OpenLayers.ImgPath="";
OpenLayers.Util.getImagesLocation=function(){return OpenLayers.ImgPath||(OpenLayers._getScriptLocation()+"img/")
};
OpenLayers.Util.Try=function(){var D=null;
for(var C=0,A=arguments.length;
C<A;
C++){var B=arguments[C];
try{D=B();
break
}catch(E){}}return D
};
OpenLayers.Util.getNodes=function(C,B){var A=OpenLayers.Util.Try(function(){return OpenLayers.Util._getNodes(C.documentElement.childNodes,B)
},function(){return OpenLayers.Util._getNodes(C.childNodes,B)
});
return A
};
OpenLayers.Util._getNodes=function(C,E){var B=[];
for(var D=0,A=C.length;
D<A;
D++){if(C[D].nodeName==E){B.push(C[D])
}}return B
};
OpenLayers.Util.getTagText=function(C,D,B){var A=OpenLayers.Util.getNodes(C,D);
if(A&&(A.length>0)){if(!B){B=0
}if(A[B].childNodes.length>1){return A.childNodes[1].nodeValue
}else{if(A[B].childNodes.length==1){return A[B].firstChild.nodeValue
}}}else{return""
}};
OpenLayers.Util.getXmlNodeValue=function(A){var B=null;
OpenLayers.Util.Try(function(){B=A.text;
if(!B){B=A.textContent
}if(!B){B=A.firstChild.nodeValue
}},function(){B=A.textContent
});
return B
};
OpenLayers.Util.mouseLeft=function(A,C){var B=(A.relatedTarget)?A.relatedTarget:A.toElement;
while(B!=C&&B!=null){B=B.parentNode
}return(B!=C)
};
OpenLayers.Util.rad=function(A){return A*Math.PI/180
};
OpenLayers.Util.distVincenty=function(F,D){var k=6378137,j=6356752.3142,e=1/298.257223563;
var M=OpenLayers.Util.rad(D.lon-F.lon);
var i=Math.atan((1-e)*Math.tan(OpenLayers.Util.rad(F.lat)));
var h=Math.atan((1-e)*Math.tan(OpenLayers.Util.rad(D.lat)));
var K=Math.sin(i),H=Math.cos(i);
var J=Math.sin(h),G=Math.cos(h);
var Q=M,N=2*Math.PI;
var P=20;
while(Math.abs(Q-N)>1e-12&&--P>0){var X=Math.sin(Q),E=Math.cos(Q);
var l=Math.sqrt((G*X)*(G*X)+(H*J-K*G*E)*(H*J-K*G*E));
if(l==0){return 0
}var Z=K*J+H*G*E;
var W=Math.atan2(l,Z);
var I=Math.asin(H*G*X/l);
var c=Math.cos(I)*Math.cos(I);
var O=Z-2*K*J/c;
var T=e/16*c*(4+e*(4-3*c));
N=Q;
Q=M+(1-T)*e*Math.sin(I)*(W+T*l*(O+T*Z*(-1+2*O*O)))
}if(P==0){return NaN
}var S=c*(k*k-j*j)/(j*j);
var V=1+S/16384*(4096+S*(-768+S*(320-175*S)));
var U=S/1024*(256+S*(-128+S*(74-47*S)));
var Y=U*l*(O+U/4*(Z*(-1+2*O*O)-U/6*O*(-3+4*l*l)*(-3+4*O*O)));
var R=j*V*(W-Y);
var g=R.toFixed(3)/1000;
return g
};
OpenLayers.Util.getParameters=function(B){B=B||window.location.href;
var A="";
if(OpenLayers.String.contains(B,"?")){var C=B.indexOf("?")+1;
var E=OpenLayers.String.contains(B,"#")?B.indexOf("#"):B.length;
A=B.substring(C,E)
}var M={};
var D=A.split(/[&;]/);
for(var H=0,I=D.length;
H<I;
++H){var G=D[H].split("=");
if(G[0]){var K=decodeURIComponent(G[0]);
var J=G[1]||"";
J=J.split(",");
for(var F=0,L=J.length;
F<L;
F++){J[F]=decodeURIComponent(J[F])
}if(J.length==1){J=J[0]
}M[K]=J
}}return M
};
OpenLayers.Util.getArgs=function(A){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.Util.getParameters"}));
return OpenLayers.Util.getParameters(A)
};
OpenLayers.Util.lastSeqID=0;
OpenLayers.Util.createUniqueID=function(A){if(A==null){A="id_"
}OpenLayers.Util.lastSeqID+=1;
return A+OpenLayers.Util.lastSeqID
};
OpenLayers.INCHES_PER_UNIT={inches:1,ft:12,mi:63360,m:39.3701,km:39370.1,dd:4374754,yd:36};
OpenLayers.INCHES_PER_UNIT["in"]=OpenLayers.INCHES_PER_UNIT.inches;
OpenLayers.INCHES_PER_UNIT.degrees=OpenLayers.INCHES_PER_UNIT.dd;
OpenLayers.INCHES_PER_UNIT.nmi=1852*OpenLayers.INCHES_PER_UNIT.m;
OpenLayers.DOTS_PER_INCH=72;
OpenLayers.Util.normalizeScale=function(B){var A=(B>1)?(1/B):B;
return A
};
OpenLayers.Util.getResolutionFromScale=function(D,A){if(A==null){A="degrees"
}var C=OpenLayers.Util.normalizeScale(D);
var B=1/(C*OpenLayers.INCHES_PER_UNIT[A]*OpenLayers.DOTS_PER_INCH);
return B
};
OpenLayers.Util.getScaleFromResolution=function(B,A){if(A==null){A="degrees"
}var C=B*OpenLayers.INCHES_PER_UNIT[A]*OpenLayers.DOTS_PER_INCH;
return C
};
OpenLayers.Util.safeStopPropagation=function(A){OpenLayers.Event.stop(A,true)
};
OpenLayers.Util.pagePosition=function(E){var A=0,D=0;
var B=E;
var F=E;
while(B){if(B==document.body){if(OpenLayers.Element.getStyle(F,"position")=="absolute"){break
}}A+=B.offsetTop||0;
D+=B.offsetLeft||0;
F=B;
try{B=B.offsetParent
}catch(C){OpenLayers.Console.error(OpenLayers.i18n("pagePositionFailed",{elemId:B.id}));
break
}}B=E;
while(B){A-=B.scrollTop||0;
D-=B.scrollLeft||0;
B=B.parentNode
}return[D,A]
};
OpenLayers.Util.isEquivalentUrl=function(H,G,C){C=C||{};
OpenLayers.Util.applyDefaults(C,{ignoreCase:true,ignorePort80:true,ignoreHash:true});
var B=OpenLayers.Util.createUrlObject(H,C);
var A=OpenLayers.Util.createUrlObject(G,C);
for(var D in B){if(C.test){OpenLayers.Console.userError(D+"\n1:"+B[D]+"\n2:"+A[D])
}var F=B[D];
var E=A[D];
switch(D){case"args":break;
case"host":case"port":case"protocol":if((F=="")||(E=="")){break
}default:if((D!="args")&&(B[D]!=A[D])){return false
}break
}}for(var D in B.args){if(B.args[D]!=A.args[D]){return false
}delete A.args[D]
}for(var D in A.args){return false
}return true
};
OpenLayers.Util.createUrlObject=function(E,C){C=C||{};
var Q={};
if(C.ignoreCase){E=E.toLowerCase()
}var S=document.createElement("a");
S.href=E;
Q.host=S.host;
var J=S.port;
if(J.length<=0){var N=Q.host.length-(J.length);
Q.host=Q.host.substring(0,N)
}Q.protocol=S.protocol;
Q.port=((J=="80")&&(C.ignorePort80))?"":J;
Q.hash=(C.ignoreHash)?"":S.hash;
var B=S.search;
if(!B){var H=E.indexOf("?");
B=(H!=-1)?E.substr(H):""
}Q.args=OpenLayers.Util.getParameters(B);
if(((Q.protocol=="file:")&&(E.indexOf("file:")!=-1))||((Q.protocol!="file:")&&(Q.host!=""))){Q.pathname=S.pathname;
var K=Q.pathname.indexOf("?");
if(K!=-1){Q.pathname=Q.pathname.substring(0,K)
}}else{var I=OpenLayers.Util.removeTail(E);
var P=0;
do{var F=I.indexOf("../");
if(F==0){P++;
I=I.substr(3)
}else{if(F>=0){var L=I.substr(0,F-1);
var O=L.indexOf("/");
L=(O!=-1)?L.substr(0,O+1):"";
var R=I.substr(F+3);
I=L+R
}}}while(F!=-1);
var D=document.createElement("a");
var M=window.location.href;
if(C.ignoreCase){M=M.toLowerCase()
}D.href=M;
Q.protocol=D.protocol;
var A=(D.pathname.indexOf("/")!=-1)?"/":"\\";
var G=D.pathname.split(A);
G.pop();
while((P>0)&&(G.length>0)){G.pop();
P--
}I=G.join("/")+"/"+I;
Q.pathname=I
}if((Q.protocol=="file:")||(Q.protocol=="")){Q.host="localhost"
}return Q
};
OpenLayers.Util.removeTail=function(B){var C=null;
var A=B.indexOf("?");
var D=B.indexOf("#");
if(A==-1){C=(D!=-1)?B.substr(0,D):B
}else{C=(D!=-1)?B.substr(0,Math.min(A,D)):B.substr(0,A)
}return C
};
OpenLayers.Util.getBrowserName=function(){var B="";
var A=navigator.userAgent.toLowerCase();
if(A.indexOf("opera")!=-1){B="opera"
}else{if(A.indexOf("msie")!=-1){B="msie"
}else{if(A.indexOf("safari")!=-1){B="safari"
}else{if(A.indexOf("mozilla")!=-1){if(A.indexOf("firefox")!=-1){B="firefox"
}else{B="mozilla"
}}}}}return B
};
OpenLayers.Util.getRenderedDimensions=function(G,D,C){var B,E;
var A=document.createElement("div");
A.style.overflow="";
A.style.position="absolute";
A.style.left="-9999px";
if(D){if(D.w){B=D.w;
A.style.width=B+"px"
}else{if(D.h){E=D.h;
A.style.height=E+"px"
}}}if(C&&C.displayClass){A.className=C.displayClass
}var F=document.createElement("div");
F.innerHTML=G;
A.appendChild(F);
document.body.appendChild(A);
if(!B){B=parseInt(F.scrollWidth);
A.style.width=B+"px"
}if(!E){E=parseInt(F.scrollHeight)
}A.removeChild(F);
document.body.removeChild(A);
return new OpenLayers.Size(B,E)
};
OpenLayers.Util.getScrollbarWidth=function(){var C=OpenLayers.Util._scrollbarWidth;
if(C==null){var E=null;
var D=null;
var A=0;
var B=0;
E=document.createElement("div");
E.style.position="absolute";
E.style.top="-1000px";
E.style.left="-1000px";
E.style.width="100px";
E.style.height="50px";
E.style.overflow="hidden";
D=document.createElement("div");
D.style.width="100%";
D.style.height="200px";
E.appendChild(D);
document.body.appendChild(E);
A=D.offsetWidth;
E.style.overflow="scroll";
B=D.offsetWidth;
document.body.removeChild(document.body.lastChild);
OpenLayers.Util._scrollbarWidth=(A-B);
C=OpenLayers.Util._scrollbarWidth
}return C
};OpenLayers.String={startsWith:function(B,A){return(B.indexOf(A)==0)
},contains:function(B,A){return(B.indexOf(A)!=-1)
},trim:function(A){return A.replace(/^\s*(.*?)\s*$/,"$1")
},camelize:function(F){var D=F.split("-");
var B=D[0];
for(var C=1,A=D.length;
C<A;
C++){var E=D[C];
B+=E.charAt(0).toUpperCase()+E.substring(1)
}return B
},format:function(H,A,E){if(!A){A=window
}var F=H.split("${");
var I,G,B;
for(var C=1,D=F.length;
C<D;
C++){I=F[C];
G=I.indexOf("}");
if(G>0){B=A[I.substring(0,G)];
if(typeof B=="function"){B=E?B.apply(null,E):B()
}F[C]=B+I.substring(++G)
}else{F[C]="${"+I
}}return F.join("")
},numberRegEx:/^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/,isNumeric:function(A){return OpenLayers.String.numberRegEx.test(A)
}};
if(!String.prototype.startsWith){String.prototype.startsWith=function(A){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.String.startsWith"}));
return OpenLayers.String.startsWith(this,A)
}
}if(!String.prototype.contains){String.prototype.contains=function(A){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.String.contains"}));
return OpenLayers.String.contains(this,A)
}
}if(!String.prototype.trim){String.prototype.trim=function(){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.String.trim"}));
return OpenLayers.String.trim(this)
}
}if(!String.prototype.camelize){String.prototype.camelize=function(){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.String.camelize"}));
return OpenLayers.String.camelize(this)
}
}OpenLayers.Number={decimalSeparator:".",thousandsSeparator:",",limitSigDigs:function(A,C){var B=0;
if(C>0){B=parseFloat(A.toPrecision(C))
}return B
},format:function(C,A,G,I){A=(typeof A!="undefined")?A:0;
G=(typeof G!="undefined")?G:OpenLayers.Number.thousandsSeparator;
I=(typeof I!="undefined")?I:OpenLayers.Number.decimalSeparator;
if(A!=null){C=parseFloat(C.toFixed(A))
}var B=C.toString().split(".");
if(B.length==1&&A==null){A=0
}var D=B[0];
if(G){var E=/(-?[0-9]+)([0-9]{3})/;
while(E.test(D)){D=D.replace(E,"$1"+G+"$2")
}}var F;
if(A==0){F=D
}else{var H=B.length>1?B[1]:"0";
if(A!=null){H=H+new Array(A-H.length+1).join("0")
}F=D+I+H
}return F
}};
if(!Number.prototype.limitSigDigs){Number.prototype.limitSigDigs=function(A){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.Number.limitSigDigs"}));
return OpenLayers.Number.limitSigDigs(this,A)
}
}OpenLayers.Function={bind:function(C,B){var A=Array.prototype.slice.apply(arguments,[2]);
return function(){var D=A.concat(Array.prototype.slice.apply(arguments,[0]));
return C.apply(B,D)
}
},bindAsEventListener:function(B,A){return function(C){return B.call(A,C||window.event)
}
}};
if(!Function.prototype.bind){Function.prototype.bind=function(){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.Function.bind"}));
Array.prototype.unshift.apply(arguments,[this]);
return OpenLayers.Function.bind.apply(null,arguments)
}
}if(!Function.prototype.bindAsEventListener){Function.prototype.bindAsEventListener=function(A){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.Function.bindAsEventListener"}));
return OpenLayers.Function.bindAsEventListener(this,A)
}
}OpenLayers.Array={filter:function(G,F,B){var D=[];
if(Array.prototype.filter){D=G.filter(F,B)
}else{var A=G.length;
if(typeof F!="function"){throw new TypeError()
}for(var C=0;
C<A;
C++){if(C in G){var E=G[C];
if(F.call(B,E,C,G)){D.push(E)
}}}}return D
}};OpenLayers.Class=function(){var C=function(){if(arguments&&arguments[0]!=OpenLayers.Class.isPrototype){this.initialize.apply(this,arguments)
}};
var B={};
var E;
for(var D=0,A=arguments.length;
D<A;
++D){if(typeof arguments[D]=="function"){E=arguments[D].prototype
}else{E=arguments[D]
}OpenLayers.Util.extend(B,E)
}C.prototype=B;
return C
};
OpenLayers.Class.isPrototype=function(){};
OpenLayers.Class.create=function(){return function(){if(arguments&&arguments[0]!=OpenLayers.Class.isPrototype){this.initialize.apply(this,arguments)
}}
};
OpenLayers.Class.inherit=function(){var D=arguments[0];
var E=new D(OpenLayers.Class.isPrototype);
for(var C=1,A=arguments.length;
C<A;
C++){if(typeof arguments[C]=="function"){var B=arguments[C];
arguments[C]=new B(OpenLayers.Class.isPrototype)
}OpenLayers.Util.extend(E,arguments[C])
}return E
};OpenLayers.Bounds=OpenLayers.Class({left:null,bottom:null,right:null,top:null,initialize:function(D,A,B,C){if(D!=null){this.left=parseFloat(D)
}if(A!=null){this.bottom=parseFloat(A)
}if(B!=null){this.right=parseFloat(B)
}if(C!=null){this.top=parseFloat(C)
}},clone:function(){return new OpenLayers.Bounds(this.left,this.bottom,this.right,this.top)
},equals:function(B){var A=false;
if(B!=null){A=((this.left==B.left)&&(this.right==B.right)&&(this.top==B.top)&&(this.bottom==B.bottom))
}return A
},toString:function(){return("left-bottom=("+this.left+","+this.bottom+") right-top=("+this.right+","+this.top+")")
},toArray:function(){return[this.left,this.bottom,this.right,this.top]
},toBBOX:function(A){if(A==null){A=6
}var B=Math.pow(10,A);
var C=Math.round(this.left*B)/B+","+Math.round(this.bottom*B)/B+","+Math.round(this.right*B)/B+","+Math.round(this.top*B)/B;
return C
},toGeometry:function(){return new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing([new OpenLayers.Geometry.Point(this.left,this.bottom),new OpenLayers.Geometry.Point(this.right,this.bottom),new OpenLayers.Geometry.Point(this.right,this.top),new OpenLayers.Geometry.Point(this.left,this.top)])])
},getWidth:function(){return(this.right-this.left)
},getHeight:function(){return(this.top-this.bottom)
},getSize:function(){return new OpenLayers.Size(this.getWidth(),this.getHeight())
},getCenterPixel:function(){return new OpenLayers.Pixel((this.left+this.right)/2,(this.bottom+this.top)/2)
},getCenterLonLat:function(){return new OpenLayers.LonLat((this.left+this.right)/2,(this.bottom+this.top)/2)
},scale:function(F,H){if(H==null){H=this.getCenterLonLat()
}var A=[];
var E,D;
if(H.CLASS_NAME=="OpenLayers.LonLat"){E=H.lon;
D=H.lat
}else{E=H.x;
D=H.y
}var C=(this.left-E)*F+E;
var B=(this.bottom-D)*F+D;
var I=(this.right-E)*F+E;
var G=(this.top-D)*F+D;
return new OpenLayers.Bounds(C,B,I,G)
},add:function(A,C){if((A==null)||(C==null)){var B=OpenLayers.i18n("boundsAddError");
OpenLayers.Console.error(B);
return null
}return new OpenLayers.Bounds(this.left+A,this.bottom+C,this.right+A,this.top+C)
},extend:function(A){var B=null;
if(A){switch(A.CLASS_NAME){case"OpenLayers.LonLat":B=new OpenLayers.Bounds(A.lon,A.lat,A.lon,A.lat);
break;
case"OpenLayers.Geometry.Point":B=new OpenLayers.Bounds(A.x,A.y,A.x,A.y);
break;
case"OpenLayers.Bounds":B=A;
break
}if(B){if((this.left==null)||(B.left<this.left)){this.left=B.left
}if((this.bottom==null)||(B.bottom<this.bottom)){this.bottom=B.bottom
}if((this.right==null)||(B.right>this.right)){this.right=B.right
}if((this.top==null)||(B.top>this.top)){this.top=B.top
}}}},containsLonLat:function(B,A){return this.contains(B.lon,B.lat,A)
},containsPixel:function(B,A){return this.contains(B.x,B.y,A)
},contains:function(B,D,A){if(A==null){A=true
}var C=false;
if(A){C=((B>=this.left)&&(B<=this.right)&&(D>=this.bottom)&&(D<=this.top))
}else{C=((B>this.left)&&(B<this.right)&&(D>this.bottom)&&(D<this.top))
}return C
},intersectsBounds:function(D,B){if(B==null){B=true
}var F=(D.bottom==this.bottom&&D.top==this.top)?true:(((D.bottom>this.bottom)&&(D.bottom<this.top))||((this.bottom>D.bottom)&&(this.bottom<D.top)));
var E=(D.bottom==this.bottom&&D.top==this.top)?true:(((D.top>this.bottom)&&(D.top<this.top))||((this.top>D.bottom)&&(this.top<D.top)));
var A=(D.right==this.right&&D.left==this.left)?true:(((D.right>this.left)&&(D.right<this.right))||((this.right>D.left)&&(this.right<D.right)));
var C=(D.right==this.right&&D.left==this.left)?true:(((D.left>this.left)&&(D.left<this.right))||((this.left>D.left)&&(this.left<D.right)));
return(this.containsBounds(D,true,B)||D.containsBounds(this,true,B)||((E||F)&&(C||A)))
},containsBounds:function(E,D,B){if(D==null){D=false
}if(B==null){B=true
}var C;
var G;
var A;
var F;
if(B){C=(E.left>=this.left)&&(E.left<=this.right);
G=(E.top>=this.bottom)&&(E.top<=this.top);
A=(E.right>=this.left)&&(E.right<=this.right);
F=(E.bottom>=this.bottom)&&(E.bottom<=this.top)
}else{C=(E.left>this.left)&&(E.left<this.right);
G=(E.top>this.bottom)&&(E.top<this.top);
A=(E.right>this.left)&&(E.right<this.right);
F=(E.bottom>this.bottom)&&(E.bottom<this.top)
}return(D)?(G||F)&&(C||A):(G&&C&&F&&A)
},determineQuadrant:function(C){var B="";
var A=this.getCenterLonLat();
B+=(C.lat<A.lat)?"b":"t";
B+=(C.lon<A.lon)?"l":"r";
return B
},transform:function(D,B){var E=OpenLayers.Projection.transform({x:this.left,y:this.bottom},D,B);
var A=OpenLayers.Projection.transform({x:this.right,y:this.bottom},D,B);
var C=OpenLayers.Projection.transform({x:this.left,y:this.top},D,B);
var F=OpenLayers.Projection.transform({x:this.right,y:this.top},D,B);
this.left=Math.min(E.x,C.x);
this.bottom=Math.min(E.y,A.y);
this.right=Math.max(A.x,F.x);
this.top=Math.max(C.y,F.y);
return this
},wrapDateLine:function(A,C){C=C||{};
var D=C.leftTolerance||0;
var B=C.rightTolerance||0;
var E=this.clone();
if(A){while(E.left<A.left&&(E.right-B)<=A.left){E=E.add(A.getWidth(),0)
}while((E.left+D)>=A.right&&E.right>A.right){E=E.add(-A.getWidth(),0)
}}return E
},CLASS_NAME:"OpenLayers.Bounds"});
OpenLayers.Bounds.fromString=function(B){var A=B.split(",");
return OpenLayers.Bounds.fromArray(A)
};
OpenLayers.Bounds.fromArray=function(A){return new OpenLayers.Bounds(parseFloat(A[0]),parseFloat(A[1]),parseFloat(A[2]),parseFloat(A[3]))
};
OpenLayers.Bounds.fromSize=function(A){return new OpenLayers.Bounds(0,A.h,A.w,0)
};
OpenLayers.Bounds.oppositeQuadrant=function(A){var B="";
B+=(A.charAt(0)=="t")?"b":"t";
B+=(A.charAt(1)=="l")?"r":"l";
return B
};OpenLayers.Element={visible:function(A){return OpenLayers.Util.getElement(A).style.display!="none"
},toggle:function(){for(var C=0,A=arguments.length;
C<A;
C++){var B=OpenLayers.Util.getElement(arguments[C]);
var D=OpenLayers.Element.visible(B)?"hide":"show";
OpenLayers.Element[D](B)
}},hide:function(){for(var C=0,A=arguments.length;
C<A;
C++){var B=OpenLayers.Util.getElement(arguments[C]);
B.style.display="none"
}},show:function(){for(var C=0,A=arguments.length;
C<A;
C++){var B=OpenLayers.Util.getElement(arguments[C]);
B.style.display=""
}},remove:function(A){A=OpenLayers.Util.getElement(A);
A.parentNode.removeChild(A)
},getHeight:function(A){A=OpenLayers.Util.getElement(A);
return A.offsetHeight
},getDimensions:function(B){B=OpenLayers.Util.getElement(B);
if(OpenLayers.Element.getStyle(B,"display")!="none"){return{width:B.offsetWidth,height:B.offsetHeight}
}var A=B.style;
var E=A.visibility;
var C=A.position;
A.visibility="hidden";
A.position="absolute";
A.display="";
var F=B.clientWidth;
var D=B.clientHeight;
A.display="none";
A.position=C;
A.visibility=E;
return{width:F,height:D}
},hasClass:function(B,A){var C=B.className;
return(!!C&&new RegExp("(^|\\s)"+A+"(\\s|$)").test(C))
},addClass:function(B,A){if(!OpenLayers.Element.hasClass(B,A)){B.className+=(B.className?" ":"")+A
}return B
},removeClass:function(B,A){var C=B.className;
if(C){B.className=OpenLayers.String.trim(C.replace(new RegExp("(^|\\s+)"+A+"(\\s+|$)")," "))
}return B
},toggleClass:function(B,A){if(OpenLayers.Element.hasClass(B,A)){OpenLayers.Element.removeClass(B,A)
}else{OpenLayers.Element.addClass(B,A)
}return B
},getStyle:function(C,D){C=OpenLayers.Util.getElement(C);
var E=null;
if(C&&C.style){E=C.style[OpenLayers.String.camelize(D)];
if(!E){if(document.defaultView&&document.defaultView.getComputedStyle){var B=document.defaultView.getComputedStyle(C,null);
E=B?B.getPropertyValue(D):null
}else{if(C.currentStyle){E=C.currentStyle[OpenLayers.String.camelize(D)]
}}}var A=["left","top","right","bottom"];
if(window.opera&&(OpenLayers.Util.indexOf(A,D)!=-1)&&(OpenLayers.Element.getStyle(C,"position")=="static")){E="auto"
}}return E=="auto"?null:E
}};OpenLayers.LonLat=OpenLayers.Class({lon:0,lat:0,initialize:function(B,A){this.lon=parseFloat(B);
this.lat=parseFloat(A)
},toString:function(){return("lon="+this.lon+",lat="+this.lat)
},toShortString:function(){return(this.lon+", "+this.lat)
},clone:function(){return new OpenLayers.LonLat(this.lon,this.lat)
},add:function(C,A){if((C==null)||(A==null)){var B=OpenLayers.i18n("lonlatAddError");
OpenLayers.Console.error(B);
return null
}return new OpenLayers.LonLat(this.lon+C,this.lat+A)
},equals:function(B){var A=false;
if(B!=null){A=((this.lon==B.lon&&this.lat==B.lat)||(isNaN(this.lon)&&isNaN(this.lat)&&isNaN(B.lon)&&isNaN(B.lat)))
}return A
},transform:function(C,B){var A=OpenLayers.Projection.transform({x:this.lon,y:this.lat},C,B);
this.lon=A.x;
this.lat=A.y;
return this
},wrapDateLine:function(A){var B=this.clone();
if(A){while(B.lon<A.left){B.lon+=A.getWidth()
}while(B.lon>A.right){B.lon-=A.getWidth()
}}return B
},CLASS_NAME:"OpenLayers.LonLat"});
OpenLayers.LonLat.fromString=function(B){var A=B.split(",");
return new OpenLayers.LonLat(parseFloat(A[0]),parseFloat(A[1]))
};OpenLayers.Pixel=OpenLayers.Class({x:0,y:0,initialize:function(A,B){this.x=parseFloat(A);
this.y=parseFloat(B)
},toString:function(){return("x="+this.x+",y="+this.y)
},clone:function(){return new OpenLayers.Pixel(this.x,this.y)
},equals:function(A){var B=false;
if(A!=null){B=((this.x==A.x&&this.y==A.y)||(isNaN(this.x)&&isNaN(this.y)&&isNaN(A.x)&&isNaN(A.y)))
}return B
},add:function(A,C){if((A==null)||(C==null)){var B=OpenLayers.i18n("pixelAddError");
OpenLayers.Console.error(B);
return null
}return new OpenLayers.Pixel(this.x+A,this.y+C)
},offset:function(A){var B=this.clone();
if(A){B=this.add(A.x,A.y)
}return B
},CLASS_NAME:"OpenLayers.Pixel"});OpenLayers.Size=OpenLayers.Class({w:0,h:0,initialize:function(A,B){this.w=parseFloat(A);
this.h=parseFloat(B)
},toString:function(){return("w="+this.w+",h="+this.h)
},clone:function(){return new OpenLayers.Size(this.w,this.h)
},equals:function(B){var A=false;
if(B!=null){A=((this.w==B.w&&this.h==B.h)||(isNaN(this.w)&&isNaN(this.h)&&isNaN(B.w)&&isNaN(B.h)))
}return A
},CLASS_NAME:"OpenLayers.Size"});OpenLayers.Console={log:function(){},debug:function(){},info:function(){},warn:function(){},error:function(){},userError:function(A){alert(A)
},assert:function(){},dir:function(){},dirxml:function(){},trace:function(){},group:function(){},groupEnd:function(){},time:function(){},timeEnd:function(){},profile:function(){},profileEnd:function(){},count:function(){},CLASS_NAME:"OpenLayers.Console"};
(function(){var B=document.getElementsByTagName("script");
for(var C=0,A=B.length;
C<A;
++C){if(B[C].src.indexOf("firebug.js")!=-1){if(console){OpenLayers.Util.extend(OpenLayers.Console,console);
break
}}}})();OpenLayers.Tween=OpenLayers.Class({INTERVAL:10,easing:null,begin:null,finish:null,duration:null,callbacks:null,time:null,interval:null,playing:false,initialize:function(A){this.easing=(A)?A:OpenLayers.Easing.Expo.easeOut
},start:function(C,B,D,A){this.playing=true;
this.begin=C;
this.finish=B;
this.duration=D;
this.callbacks=A.callbacks;
this.time=0;
if(this.interval){window.clearInterval(this.interval);
this.interval=null
}if(this.callbacks&&this.callbacks.start){this.callbacks.start.call(this,this.begin)
}this.interval=window.setInterval(OpenLayers.Function.bind(this.play,this),this.INTERVAL)
},stop:function(){if(!this.playing){return 
}if(this.callbacks&&this.callbacks.done){this.callbacks.done.call(this,this.finish)
}window.clearInterval(this.interval);
this.interval=null;
this.playing=false
},play:function(){var D={};
for(var B in this.begin){var A=this.begin[B];
var C=this.finish[B];
if(A==null||C==null||isNaN(A)||isNaN(C)){OpenLayers.Console.error("invalid value for Tween")
}var E=C-A;
D[B]=this.easing.apply(this,[this.time,A,E,this.duration])
}this.time++;
if(this.callbacks&&this.callbacks.eachStep){this.callbacks.eachStep.call(this,D)
}if(this.time>this.duration){if(this.callbacks&&this.callbacks.done){this.callbacks.done.call(this,this.finish);
this.playing=false
}window.clearInterval(this.interval);
this.interval=null
}},CLASS_NAME:"OpenLayers.Tween"});
OpenLayers.Easing={CLASS_NAME:"OpenLayers.Easing"};
OpenLayers.Easing.Linear={easeIn:function(B,A,D,C){return D*B/C+A
},easeOut:function(B,A,D,C){return D*B/C+A
},easeInOut:function(B,A,D,C){return D*B/C+A
},CLASS_NAME:"OpenLayers.Easing.Linear"};
OpenLayers.Easing.Expo={easeIn:function(B,A,D,C){return(B==0)?A:D*Math.pow(2,10*(B/C-1))+A
},easeOut:function(B,A,D,C){return(B==C)?A+D:D*(-Math.pow(2,-10*B/C)+1)+A
},easeInOut:function(B,A,D,C){if(B==0){return A
}if(B==C){return A+D
}if((B/=C/2)<1){return D/2*Math.pow(2,10*(B-1))+A
}return D/2*(-Math.pow(2,-10*--B)+2)+A
},CLASS_NAME:"OpenLayers.Easing.Expo"};
OpenLayers.Easing.Quad={easeIn:function(B,A,D,C){return D*(B/=C)*B+A
},easeOut:function(B,A,D,C){return -D*(B/=C)*(B-2)+A
},easeInOut:function(B,A,D,C){if((B/=C/2)<1){return D/2*B*B+A
}return -D/2*((--B)*(B-2)-1)+A
},CLASS_NAME:"OpenLayers.Easing.Quad"};OpenLayers.Rico=new Object();
OpenLayers.Rico.Corner={round:function(D,B){D=OpenLayers.Util.getElement(D);
this._setOptions(B);
var A=this.options.color;
if(this.options.color=="fromElement"){A=this._background(D)
}var C=this.options.bgColor;
if(this.options.bgColor=="fromParent"){C=this._background(D.offsetParent)
}this._roundCornersImpl(D,A,C)
},changeColor:function(C,B){C.style.backgroundColor=B;
var A=C.parentNode.getElementsByTagName("span");
for(var D=0;
D<A.length;
D++){A[D].style.backgroundColor=B
}},changeOpacity:function(C,F){var D=F;
var A="alpha(opacity="+F*100+")";
C.style.opacity=D;
C.style.filter=A;
var B=C.parentNode.getElementsByTagName("span");
for(var E=0;
E<B.length;
E++){B[E].style.opacity=D;
B[E].style.filter=A
}},reRound:function(D,C){var B=D.parentNode.childNodes[0];
var A=D.parentNode.childNodes[2];
D.parentNode.removeChild(B);
D.parentNode.removeChild(A);
this.round(D.parentNode,C)
},_roundCornersImpl:function(C,A,B){if(this.options.border){this._renderBorder(C,B)
}if(this._isTopRounded()){this._roundTopCorners(C,A,B)
}if(this._isBottomRounded()){this._roundBottomCorners(C,A,B)
}},_renderBorder:function(D,E){var B="1px solid "+this._borderColor(E);
var A="border-left: "+B;
var F="border-right: "+B;
var C="style='"+A+";"+F+"'";
D.innerHTML="<div "+C+">"+D.innerHTML+"</div>"
},_roundTopCorners:function(C,A,E){var D=this._createCorner(E);
for(var B=0;
B<this.options.numSlices;
B++){D.appendChild(this._createCornerSlice(A,E,B,"top"))
}C.style.paddingTop=0;
C.insertBefore(D,C.firstChild)
},_roundBottomCorners:function(C,A,E){var D=this._createCorner(E);
for(var B=(this.options.numSlices-1);
B>=0;
B--){D.appendChild(this._createCornerSlice(A,E,B,"bottom"))
}C.style.paddingBottom=0;
C.appendChild(D)
},_createCorner:function(B){var A=document.createElement("div");
A.style.backgroundColor=(this._isTransparent()?"transparent":B);
return A
},_createCornerSlice:function(C,D,G,A){var E=document.createElement("span");
var B=E.style;
B.backgroundColor=C;
B.display="block";
B.height="1px";
B.overflow="hidden";
B.fontSize="1px";
var F=this._borderColor(C,D);
if(this.options.border&&G==0){B.borderTopStyle="solid";
B.borderTopWidth="1px";
B.borderLeftWidth="0px";
B.borderRightWidth="0px";
B.borderBottomWidth="0px";
B.height="0px";
B.borderColor=F
}else{if(F){B.borderColor=F;
B.borderStyle="solid";
B.borderWidth="0px 1px"
}}if(!this.options.compact&&(G==(this.options.numSlices-1))){B.height="2px"
}this._setMargin(E,G,A);
this._setBorder(E,G,A);
return E
},_setOptions:function(A){this.options={corners:"all",color:"fromElement",bgColor:"fromParent",blend:true,border:false,compact:false};
OpenLayers.Util.extend(this.options,A||{});
this.options.numSlices=this.options.compact?2:4;
if(this._isTransparent()){this.options.blend=false
}},_whichSideTop:function(){if(this._hasString(this.options.corners,"all","top")){return""
}if(this.options.corners.indexOf("tl")>=0&&this.options.corners.indexOf("tr")>=0){return""
}if(this.options.corners.indexOf("tl")>=0){return"left"
}else{if(this.options.corners.indexOf("tr")>=0){return"right"
}}return""
},_whichSideBottom:function(){if(this._hasString(this.options.corners,"all","bottom")){return""
}if(this.options.corners.indexOf("bl")>=0&&this.options.corners.indexOf("br")>=0){return""
}if(this.options.corners.indexOf("bl")>=0){return"left"
}else{if(this.options.corners.indexOf("br")>=0){return"right"
}}return""
},_borderColor:function(A,B){if(A=="transparent"){return B
}else{if(this.options.border){return this.options.border
}else{if(this.options.blend){return this._blend(B,A)
}else{return""
}}}},_setMargin:function(D,E,B){var C=this._marginSize(E);
var A=B=="top"?this._whichSideTop():this._whichSideBottom();
if(A=="left"){D.style.marginLeft=C+"px";
D.style.marginRight="0px"
}else{if(A=="right"){D.style.marginRight=C+"px";
D.style.marginLeft="0px"
}else{D.style.marginLeft=C+"px";
D.style.marginRight=C+"px"
}}},_setBorder:function(D,E,B){var C=this._borderSize(E);
var A=B=="top"?this._whichSideTop():this._whichSideBottom();
if(A=="left"){D.style.borderLeftWidth=C+"px";
D.style.borderRightWidth="0px"
}else{if(A=="right"){D.style.borderRightWidth=C+"px";
D.style.borderLeftWidth="0px"
}else{D.style.borderLeftWidth=C+"px";
D.style.borderRightWidth=C+"px"
}}if(this.options.border!=false){D.style.borderLeftWidth=C+"px";
D.style.borderRightWidth=C+"px"
}},_marginSize:function(E){if(this._isTransparent()){return 0
}var D=[5,3,2,1];
var A=[3,2,1,0];
var C=[2,1];
var B=[1,0];
if(this.options.compact&&this.options.blend){return B[E]
}else{if(this.options.compact){return C[E]
}else{if(this.options.blend){return A[E]
}else{return D[E]
}}}},_borderSize:function(E){var D=[5,3,2,1];
var B=[2,1,1,1];
var A=[1,0];
var C=[0,2,0,0];
if(this.options.compact&&(this.options.blend||this._isTransparent())){return 1
}else{if(this.options.compact){return A[E]
}else{if(this.options.blend){return B[E]
}else{if(this.options.border){return C[E]
}else{if(this._isTransparent()){return D[E]
}}}}}return 0
},_hasString:function(B){for(var A=1;
A<arguments.length;
A++){if(B.indexOf(arguments[A])>=0){return true
}}return false
},_blend:function(C,A){var B=OpenLayers.Rico.Color.createFromHex(C);
B.blend(OpenLayers.Rico.Color.createFromHex(A));
return B
},_background:function(A){try{return OpenLayers.Rico.Color.createColorFromBackground(A).asHex()
}catch(B){return"#ffffff"
}},_isTransparent:function(){return this.options.color=="transparent"
},_isTopRounded:function(){return this._hasString(this.options.corners,"all","top","tl","tr")
},_isBottomRounded:function(){return this._hasString(this.options.corners,"all","bottom","bl","br")
},_hasSingleTextChild:function(A){return A.childNodes.length==1&&A.childNodes[0].nodeType==3
}};OpenLayers.Rico.Color=OpenLayers.Class({initialize:function(C,B,A){this.rgb={r:C,g:B,b:A}
},setRed:function(A){this.rgb.r=A
},setGreen:function(A){this.rgb.g=A
},setBlue:function(A){this.rgb.b=A
},setHue:function(B){var A=this.asHSB();
A.h=B;
this.rgb=OpenLayers.Rico.Color.HSBtoRGB(A.h,A.s,A.b)
},setSaturation:function(B){var A=this.asHSB();
A.s=B;
this.rgb=OpenLayers.Rico.Color.HSBtoRGB(A.h,A.s,A.b)
},setBrightness:function(A){var B=this.asHSB();
B.b=A;
this.rgb=OpenLayers.Rico.Color.HSBtoRGB(B.h,B.s,B.b)
},darken:function(B){var A=this.asHSB();
this.rgb=OpenLayers.Rico.Color.HSBtoRGB(A.h,A.s,Math.max(A.b-B,0))
},brighten:function(B){var A=this.asHSB();
this.rgb=OpenLayers.Rico.Color.HSBtoRGB(A.h,A.s,Math.min(A.b+B,1))
},blend:function(A){this.rgb.r=Math.floor((this.rgb.r+A.rgb.r)/2);
this.rgb.g=Math.floor((this.rgb.g+A.rgb.g)/2);
this.rgb.b=Math.floor((this.rgb.b+A.rgb.b)/2)
},isBright:function(){var A=this.asHSB();
return this.asHSB().b>0.5
},isDark:function(){return !this.isBright()
},asRGB:function(){return"rgb("+this.rgb.r+","+this.rgb.g+","+this.rgb.b+")"
},asHex:function(){return"#"+this.rgb.r.toColorPart()+this.rgb.g.toColorPart()+this.rgb.b.toColorPart()
},asHSB:function(){return OpenLayers.Rico.Color.RGBtoHSB(this.rgb.r,this.rgb.g,this.rgb.b)
},toString:function(){return this.asHex()
}});
OpenLayers.Rico.Color.createFromHex=function(D){if(D.length==4){var B=D;
var D="#";
for(var C=1;
C<4;
C++){D+=(B.charAt(C)+B.charAt(C))
}}if(D.indexOf("#")==0){D=D.substring(1)
}var F=D.substring(0,2);
var E=D.substring(2,4);
var A=D.substring(4,6);
return new OpenLayers.Rico.Color(parseInt(F,16),parseInt(E,16),parseInt(A,16))
};
OpenLayers.Rico.Color.createColorFromBackground=function(D){var B=RicoUtil.getElementsComputedStyle(OpenLayers.Util.getElement(D),"backgroundColor","background-color");
if(B=="transparent"&&D.parentNode){return OpenLayers.Rico.Color.createColorFromBackground(D.parentNode)
}if(B==null){return new OpenLayers.Rico.Color(255,255,255)
}if(B.indexOf("rgb(")==0){var A=B.substring(4,B.length-1);
var C=A.split(",");
return new OpenLayers.Rico.Color(parseInt(C[0]),parseInt(C[1]),parseInt(C[2]))
}else{if(B.indexOf("#")==0){return OpenLayers.Rico.Color.createFromHex(B)
}else{return new OpenLayers.Rico.Color(255,255,255)
}}};
OpenLayers.Rico.Color.HSBtoRGB=function(G,E,I){var C=0;
var D=0;
var J=0;
if(E==0){C=parseInt(I*255+0.5);
D=C;
J=C
}else{var F=(G-Math.floor(G))*6;
var H=F-Math.floor(F);
var B=I*(1-E);
var A=I*(1-E*H);
var K=I*(1-(E*(1-H)));
switch(parseInt(F)){case 0:C=(I*255+0.5);
D=(K*255+0.5);
J=(B*255+0.5);
break;
case 1:C=(A*255+0.5);
D=(I*255+0.5);
J=(B*255+0.5);
break;
case 2:C=(B*255+0.5);
D=(I*255+0.5);
J=(K*255+0.5);
break;
case 3:C=(B*255+0.5);
D=(A*255+0.5);
J=(I*255+0.5);
break;
case 4:C=(K*255+0.5);
D=(B*255+0.5);
J=(I*255+0.5);
break;
case 5:C=(I*255+0.5);
D=(B*255+0.5);
J=(A*255+0.5);
break
}}return{r:parseInt(C),g:parseInt(D),b:parseInt(J)}
};
OpenLayers.Rico.Color.RGBtoHSB=function(A,E,J){var F;
var D;
var I;
var K=(A>E)?A:E;
if(J>K){K=J
}var G=(A<E)?A:E;
if(J<G){G=J
}I=K/255;
if(K!=0){D=(K-G)/K
}else{D=0
}if(D==0){F=0
}else{var B=(K-A)/(K-G);
var H=(K-E)/(K-G);
var C=(K-J)/(K-G);
if(A==K){F=C-H
}else{if(E==K){F=2+B-C
}else{F=4+H-B
}}F=F/6;
if(F<0){F=F+1
}}return{h:F,s:D,b:I}
};(function(){if(window.google&&google.gears){return 
}var A=null;
if(typeof GearsFactory!="undefined"){A=new GearsFactory()
}else{try{A=new ActiveXObject("Gears.Factory");
if(A.getBuildInfo().indexOf("ie_mobile")!=-1){A.privateSetGlobalObject(this)
}}catch(B){if((typeof navigator.mimeTypes!="undefined")&&navigator.mimeTypes["application/x-googlegears"]){A=document.createElement("object");
A.style.display="none";
A.width=0;
A.height=0;
A.type="application/x-googlegears";
document.documentElement.appendChild(A)
}}}if(!A){return 
}if(!window.google){google={}
}if(!google.gears){google.gears={factory:A}
}})();OpenLayers.ProxyHost="";
OpenLayers.nullHandler=function(A){OpenLayers.Console.userError(OpenLayers.i18n("unhandledRequest",{statusText:A.statusText}))
};
OpenLayers.loadURL=function(D,G,B,E,C){if(typeof G=="string"){G=OpenLayers.Util.getParameters(G)
}var F=(E)?E:OpenLayers.nullHandler;
var A=(C)?C:OpenLayers.nullHandler;
return OpenLayers.Request.GET({url:D,params:G,success:F,failure:A,scope:B})
};
OpenLayers.parseXMLString=function(C){var A=C.indexOf("<");
if(A>0){C=C.substring(A)
}var B=OpenLayers.Util.Try(function(){var D=new ActiveXObject("Microsoft.XMLDOM");
D.loadXML(C);
return D
},function(){return new DOMParser().parseFromString(C,"text/xml")
},function(){var D=new XMLHttpRequest();
D.open("GET","data:text/xml;charset=utf-8,"+encodeURIComponent(C),false);
if(D.overrideMimeType){D.overrideMimeType("text/xml")
}D.send(null);
return D.responseXML
});
return B
};
OpenLayers.Ajax={emptyFunction:function(){},getTransport:function(){return OpenLayers.Util.Try(function(){return new XMLHttpRequest()
},function(){return new ActiveXObject("Msxml2.XMLHTTP")
},function(){return new ActiveXObject("Microsoft.XMLHTTP")
})||false
},activeRequestCount:0};
OpenLayers.Ajax.Responders={responders:[],register:function(B){for(var A=0;
A<this.responders.length;
A++){if(B==this.responders[A]){return 
}}this.responders.push(B)
},unregister:function(A){OpenLayers.Util.removeItem(this.reponders,A)
},dispatch:function(F,C,E){var A;
for(var B=0;
B<this.responders.length;
B++){A=this.responders[B];
if(A[F]&&typeof A[F]=="function"){try{A[F].apply(A,[C,E])
}catch(D){}}}}};
OpenLayers.Ajax.Responders.register({onCreate:function(){OpenLayers.Ajax.activeRequestCount++
},onComplete:function(){OpenLayers.Ajax.activeRequestCount--
}});
OpenLayers.Ajax.Base=OpenLayers.Class({initialize:function(A){this.options={method:"post",asynchronous:true,contentType:"application/xml",parameters:""};
OpenLayers.Util.extend(this.options,A||{});
this.options.method=this.options.method.toLowerCase();
if(typeof this.options.parameters=="string"){this.options.parameters=OpenLayers.Util.getParameters(this.options.parameters)
}}});
OpenLayers.Ajax.Request=OpenLayers.Class(OpenLayers.Ajax.Base,{_complete:false,initialize:function(B,A){OpenLayers.Ajax.Base.prototype.initialize.apply(this,[A]);
if(OpenLayers.ProxyHost&&OpenLayers.String.startsWith(B,"http")){B=OpenLayers.ProxyHost+encodeURIComponent(B)
}this.transport=OpenLayers.Ajax.getTransport();
this.request(B)
},request:function(B){this.url=B;
this.method=this.options.method;
var D=OpenLayers.Util.extend({},this.options.parameters);
if(this.method!="get"&&this.method!="post"){D._method=this.method;
this.method="post"
}this.parameters=D;
if(D=OpenLayers.Util.getParameterString(D)){if(this.method=="get"){this.url+=((this.url.indexOf("?")>-1)?"&":"?")+D
}else{if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){D+="&_="
}}}try{var A=new OpenLayers.Ajax.Response(this);
if(this.options.onCreate){this.options.onCreate(A)
}OpenLayers.Ajax.Responders.dispatch("onCreate",this,A);
this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);
if(this.options.asynchronous){window.setTimeout(OpenLayers.Function.bind(this.respondToReadyState,this,1),10)
}this.transport.onreadystatechange=OpenLayers.Function.bind(this.onStateChange,this);
this.setRequestHeaders();
this.body=this.method=="post"?(this.options.postBody||D):null;
this.transport.send(this.body);
if(!this.options.asynchronous&&this.transport.overrideMimeType){this.onStateChange()
}}catch(C){this.dispatchException(C)
}},onStateChange:function(){var A=this.transport.readyState;
if(A>1&&!((A==4)&&this._complete)){this.respondToReadyState(this.transport.readyState)
}},setRequestHeaders:function(){var E={"X-Requested-With":"XMLHttpRequest",Accept:"text/javascript, text/html, application/xml, text/xml, */*",OpenLayers:true};
if(this.method=="post"){E["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){E.Connection="close"
}}if(typeof this.options.requestHeaders=="object"){var C=this.options.requestHeaders;
if(typeof C.push=="function"){for(var B=0,D=C.length;
B<D;
B+=2){E[C[B]]=C[B+1]
}}else{for(var B in C){E[B]=C[B]
}}}for(var A in E){this.transport.setRequestHeader(A,E[A])
}},success:function(){var A=this.getStatus();
return !A||(A>=200&&A<300)
},getStatus:function(){try{return this.transport.status||0
}catch(A){return 0
}},respondToReadyState:function(A){var C=OpenLayers.Ajax.Request.Events[A];
var B=new OpenLayers.Ajax.Response(this);
if(C=="Complete"){try{this._complete=true;
(this.options["on"+B.status]||this.options["on"+(this.success()?"Success":"Failure")]||OpenLayers.Ajax.emptyFunction)(B)
}catch(D){this.dispatchException(D)
}var E=B.getHeader("Content-type")
}try{(this.options["on"+C]||OpenLayers.Ajax.emptyFunction)(B);
OpenLayers.Ajax.Responders.dispatch("on"+C,this,B)
}catch(D){this.dispatchException(D)
}if(C=="Complete"){this.transport.onreadystatechange=OpenLayers.Ajax.emptyFunction
}},getHeader:function(A){try{return this.transport.getResponseHeader(A)
}catch(B){return null
}},dispatchException:function(C){var D=this.options.onException;
if(D){D(this,C);
OpenLayers.Ajax.Responders.dispatch("onException",this,C)
}else{var E=false;
var A=OpenLayers.Ajax.Responders.responders;
for(var B=0;
B<A.length;
B++){if(A[B].onException){E=true;
break
}}if(E){OpenLayers.Ajax.Responders.dispatch("onException",this,C)
}else{throw C
}}}});
OpenLayers.Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];
OpenLayers.Ajax.Response=OpenLayers.Class({status:0,statusText:"",initialize:function(C){this.request=C;
var D=this.transport=C.transport,A=this.readyState=D.readyState;
if((A>2&&!(!!(window.attachEvent&&!window.opera)))||A==4){this.status=this.getStatus();
this.statusText=this.getStatusText();
this.responseText=D.responseText==null?"":String(D.responseText)
}if(A==4){var B=D.responseXML;
this.responseXML=B===undefined?null:B
}},getStatus:OpenLayers.Ajax.Request.prototype.getStatus,getStatusText:function(){try{return this.transport.statusText||""
}catch(A){return""
}},getHeader:OpenLayers.Ajax.Request.prototype.getHeader,getResponseHeader:function(A){return this.transport.getResponseHeader(A)
}});
OpenLayers.Ajax.getElementsByTagNameNS=function(B,A,C,E){var D=null;
if(B.getElementsByTagNameNS){D=B.getElementsByTagNameNS(A,E)
}else{D=B.getElementsByTagName(C+":"+E)
}return D
};
OpenLayers.Ajax.serializeXMLToString=function(A){var B=new XMLSerializer();
var C=B.serializeToString(A);
return C
};OpenLayers.Request={DEFAULT_CONFIG:{method:"GET",url:window.location.href,async:true,user:undefined,password:undefined,params:null,proxy:OpenLayers.ProxyHost,headers:{},data:null,callback:function(){},success:null,failure:null,scope:null},issue:function(D){var G=OpenLayers.Util.extend(this.DEFAULT_CONFIG,{proxy:OpenLayers.ProxyHost});
D=OpenLayers.Util.applyDefaults(D,G);
var F=new OpenLayers.Request.XMLHttpRequest();
var A=D.url;
if(D.params){var E=OpenLayers.Util.getParameterString(D.params);
if(E.length>0){var I=(A.indexOf("?")>-1)?"&":"?";
A+=I+E
}}if(D.proxy&&(A.indexOf("http")==0)){A=D.proxy+encodeURIComponent(A)
}F.open(D.method,A,D.async,D.user,D.password);
for(var H in D.headers){F.setRequestHeader(H,D.headers[H])
}var B=(D.scope)?OpenLayers.Function.bind(D.callback,D.scope):D.callback;
var J;
if(D.success){J=(D.scope)?OpenLayers.Function.bind(D.success,D.scope):D.success
}var C;
if(D.failure){C=(D.scope)?OpenLayers.Function.bind(D.failure,D.scope):D.failure
}F.onreadystatechange=function(){if(F.readyState==OpenLayers.Request.XMLHttpRequest.DONE){B(F);
if(J&&(!F.status||(F.status>=200&&F.status<300))){J(F)
}if(C&&(F.status&&(F.status<200||F.status>=300))){C(F)
}}};
F.send(D.data);
return F
},GET:function(A){A=OpenLayers.Util.extend(A,{method:"GET"});
return OpenLayers.Request.issue(A)
},POST:function(A){A=OpenLayers.Util.extend(A,{method:"POST"});
A.headers=A.headers?A.headers:{};
if(!("CONTENT-TYPE" in OpenLayers.Util.upperCaseObject(A.headers))){A.headers["Content-Type"]="application/xml"
}return OpenLayers.Request.issue(A)
},PUT:function(A){A=OpenLayers.Util.extend(A,{method:"PUT"});
A.headers=A.headers?A.headers:{};
if(!("CONTENT-TYPE" in OpenLayers.Util.upperCaseObject(A.headers))){A.headers["Content-Type"]="application/xml"
}return OpenLayers.Request.issue(A)
},DELETE:function(A){A=OpenLayers.Util.extend(A,{method:"DELETE"});
return OpenLayers.Request.issue(A)
},HEAD:function(A){A=OpenLayers.Util.extend(A,{method:"HEAD"});
return OpenLayers.Request.issue(A)
},OPTIONS:function(A){A=OpenLayers.Util.extend(A,{method:"OPTIONS"});
return OpenLayers.Request.issue(A)
}};(function(){var D=window.XMLHttpRequest;
var H=!!window.controllers,E=window.document.all&&!window.opera;
function C(){this._object=D?new D:new window.ActiveXObject("Microsoft.XMLHTTP")
}if(H&&D.wrapped){C.wrapped=D.wrapped
}C.UNSENT=0;
C.OPENED=1;
C.HEADERS_RECEIVED=2;
C.LOADING=3;
C.DONE=4;
C.prototype.readyState=C.UNSENT;
C.prototype.responseText="";
C.prototype.responseXML=null;
C.prototype.status=0;
C.prototype.statusText="";
C.prototype.onreadystatechange=null;
C.onreadystatechange=null;
C.onopen=null;
C.onsend=null;
C.onabort=null;
C.prototype.open=function(L,O,K,P,J){this._async=K;
var N=this,M=this.readyState;
if(E){var I=function(){if(N._object.readyState!=C.DONE){A(N)
}};
if(K){window.attachEvent("onunload",I)
}}this._object.onreadystatechange=function(){if(H&&!K){return 
}N.readyState=N._object.readyState;
G(N);
if(N._aborted){N.readyState=C.UNSENT;
return 
}if(N.readyState==C.DONE){A(N);
if(E&&K){window.detachEvent("onunload",I)
}}if(M!=N.readyState){F(N)
}M=N.readyState
};
if(C.onopen){C.onopen.apply(this,arguments)
}this._object.open(L,O,K,P,J);
if(!K&&H){this.readyState=C.OPENED;
F(this)
}};
C.prototype.send=function(I){if(C.onsend){C.onsend.apply(this,arguments)
}if(I&&I.nodeType){I=window.XMLSerializer?new window.XMLSerializer().serializeToString(I):I.xml;
if(!this._headers["Content-Type"]){this._object.setRequestHeader("Content-Type","application/xml")
}}this._object.send(I);
if(H&&!this._async){this.readyState=C.OPENED;
G(this);
while(this.readyState<C.DONE){this.readyState++;
F(this);
if(this._aborted){return 
}}}};
C.prototype.abort=function(){if(C.onabort){C.onabort.apply(this,arguments)
}if(this.readyState>C.UNSENT){this._aborted=true
}this._object.abort();
A(this)
};
C.prototype.getAllResponseHeaders=function(){return this._object.getAllResponseHeaders()
};
C.prototype.getResponseHeader=function(I){return this._object.getResponseHeader(I)
};
C.prototype.setRequestHeader=function(I,J){if(!this._headers){this._headers={}
}this._headers[I]=J;
return this._object.setRequestHeader(I,J)
};
C.prototype.toString=function(){return"[object XMLHttpRequest]"
};
C.toString=function(){return"[XMLHttpRequest]"
};
function F(I){if(I.onreadystatechange){I.onreadystatechange.apply(I)
}if(C.onreadystatechange){C.onreadystatechange.apply(I)
}}function B(J){var I=J.responseXML;
if(E&&I&&!I.documentElement&&J.getResponseHeader("Content-Type").match(/[^\/]+\/[^\+]+\+xml/)){I=new ActiveXObject("Microsoft.XMLDOM");
I.loadXML(J.responseText)
}if(I){if((E&&I.parseError!=0)||(I.documentElement&&I.documentElement.tagName=="parsererror")){return null
}}return I
}function G(I){try{I.responseText=I._object.responseText
}catch(J){}try{I.responseXML=B(I._object)
}catch(J){}try{I.status=I._object.status
}catch(J){}try{I.statusText=I._object.statusText
}catch(J){}}function A(I){I._object.onreadystatechange=new window.Function;
delete I._headers
}if(!window.Function.prototype.apply){window.Function.prototype.apply=function(I,J){if(!J){J=[]
}I.__func=this;
I.__func(J[0],J[1],J[2],J[3],J[4]);
delete I.__func
}
}OpenLayers.Request.XMLHttpRequest=C
})();OpenLayers.Event={observers:false,KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,element:function(A){return A.target||A.srcElement
},isLeftClick:function(A){return(((A.which)&&(A.which==1))||((A.button)&&(A.button==1)))
},isRightClick:function(A){return(((A.which)&&(A.which==3))||((A.button)&&(A.button==2)))
},stop:function(B,A){if(!A){if(B.preventDefault){B.preventDefault()
}else{B.returnValue=false
}}if(B.stopPropagation){B.stopPropagation()
}else{B.cancelBubble=true
}},findElement:function(C,B){var A=OpenLayers.Event.element(C);
while(A.parentNode&&(!A.tagName||(A.tagName.toUpperCase()!=B.toUpperCase()))){A=A.parentNode
}return A
},observe:function(B,D,C,A){var E=OpenLayers.Util.getElement(B);
A=A||false;
if(D=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||E.attachEvent)){D="keydown"
}if(!this.observers){this.observers={}
}if(!E._eventCacheID){var F="eventCacheID_";
if(E.id){F=E.id+"_"+F
}E._eventCacheID=OpenLayers.Util.createUniqueID(F)
}var G=E._eventCacheID;
if(!this.observers[G]){this.observers[G]=[]
}this.observers[G].push({element:E,name:D,observer:C,useCapture:A});
if(E.addEventListener){E.addEventListener(D,C,A)
}else{if(E.attachEvent){E.attachEvent("on"+D,C)
}}},stopObservingElement:function(A){var B=OpenLayers.Util.getElement(A);
var C=B._eventCacheID;
this._removeElementObservers(OpenLayers.Event.observers[C])
},_removeElementObservers:function(E){if(E){for(var B=E.length-1;
B>=0;
B--){var C=E[B];
var A=new Array(C.element,C.name,C.observer,C.useCapture);
var D=OpenLayers.Event.stopObserving.apply(this,A)
}}},stopObserving:function(H,A,G,B){B=B||false;
var F=OpenLayers.Util.getElement(H);
var D=F._eventCacheID;
if(A=="keypress"){if(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||F.detachEvent){A="keydown"
}}var J=false;
var C=OpenLayers.Event.observers[D];
if(C){var E=0;
while(!J&&E<C.length){var I=C[E];
if((I.name==A)&&(I.observer==G)&&(I.useCapture==B)){C.splice(E,1);
if(C.length==0){delete OpenLayers.Event.observers[D]
}J=true;
break
}E++
}}if(J){if(F.removeEventListener){F.removeEventListener(A,G,B)
}else{if(F&&F.detachEvent){F.detachEvent("on"+A,G)
}}}return J
},unloadCache:function(){if(OpenLayers.Event&&OpenLayers.Event.observers){for(var A in OpenLayers.Event.observers){var B=OpenLayers.Event.observers[A];
OpenLayers.Event._removeElementObservers.apply(this,[B])
}OpenLayers.Event.observers=false
}},CLASS_NAME:"OpenLayers.Event"};
OpenLayers.Event.observe(window,"unload",OpenLayers.Event.unloadCache,false);
if(window.Event){OpenLayers.Util.applyDefaults(window.Event,OpenLayers.Event)
}else{var Event=OpenLayers.Event
}OpenLayers.Events=OpenLayers.Class({BROWSER_EVENTS:["mouseover","mouseout","mousedown","mouseup","mousemove","click","dblclick","rightclick","dblrightclick","resize","focus","blur"],listeners:null,object:null,element:null,eventTypes:null,eventHandler:null,fallThrough:null,includeXY:false,initialize:function(C,E,G,F,B){OpenLayers.Util.extend(this,B);
this.object=C;
this.element=E;
this.fallThrough=F;
this.listeners={};
this.eventHandler=OpenLayers.Function.bindAsEventListener(this.handleBrowserEvent,this);
this.eventTypes=[];
if(G!=null){for(var D=0,A=G.length;
D<A;
D++){this.addEventType(G[D])
}}if(this.element!=null){this.attachToElement(E)
}},destroy:function(){if(this.element){OpenLayers.Event.stopObservingElement(this.element)
}this.element=null;
this.listeners=null;
this.object=null;
this.eventTypes=null;
this.fallThrough=null;
this.eventHandler=null
},addEventType:function(A){if(!this.listeners[A]){this.eventTypes.push(A);
this.listeners[A]=[]
}},attachToElement:function(D){for(var C=0,A=this.BROWSER_EVENTS.length;
C<A;
C++){var B=this.BROWSER_EVENTS[C];
this.addEventType(B);
OpenLayers.Event.observe(D,B,this.eventHandler)
}OpenLayers.Event.observe(D,"dragstart",OpenLayers.Event.stop)
},on:function(A){for(var B in A){if(B!="scope"){this.register(B,A.scope,A[B])
}}},register:function(B,D,C){if((C!=null)&&(OpenLayers.Util.indexOf(this.eventTypes,B)!=-1)){if(D==null){D=this.object
}var A=this.listeners[B];
A.push({obj:D,func:C})
}},registerPriority:function(B,D,C){if(C!=null){if(D==null){D=this.object
}var A=this.listeners[B];
if(A!=null){A.unshift({obj:D,func:C})
}}},un:function(A){for(var B in A){if(B!="scope"){this.unregister(B,A.scope,A[B])
}}},unregister:function(D,F,E){if(F==null){F=this.object
}var C=this.listeners[D];
if(C!=null){for(var B=0,A=C.length;
B<A;
B++){if(C[B].obj==F&&C[B].func==E){C.splice(B,1);
break
}}}},remove:function(A){if(this.listeners[A]!=null){this.listeners[A]=[]
}},triggerEvent:function(E,B){if(B==null){B={}
}B.object=this.object;
B.element=this.element;
if(!B.type){B.type=E
}var D=(this.listeners[E])?this.listeners[E].slice():null;
if((D!=null)&&(D.length>0)){var F;
for(var C=0,A=D.length;
C<A;
C++){var G=D[C];
F=G.func.apply(G.obj,[B]);
if((F!=undefined)&&(F==false)){break
}}if(!this.fallThrough){OpenLayers.Event.stop(B,true)
}}return F
},handleBrowserEvent:function(A){if(this.includeXY){A.xy=this.getMousePosition(A)
}this.triggerEvent(A.type,A)
},clearMouseCache:function(){this.element.scrolls=null;
this.element.lefttop=null;
this.element.offsets=null
},getMousePosition:function(A){if(!this.includeXY){this.clearMouseCache()
}else{if(!this.element.hasScrollEvent){OpenLayers.Event.observe(window,"scroll",OpenLayers.Function.bind(this.clearMouseCache,this));
this.element.hasScrollEvent=true
}}if(!this.element.scrolls){this.element.scrolls=[];
this.element.scrolls[0]=(document.documentElement.scrollLeft||document.body.scrollLeft);
this.element.scrolls[1]=(document.documentElement.scrollTop||document.body.scrollTop)
}if(!this.element.lefttop){this.element.lefttop=[];
this.element.lefttop[0]=(document.documentElement.clientLeft||0);
this.element.lefttop[1]=(document.documentElement.clientTop||0)
}if(!this.element.offsets){this.element.offsets=OpenLayers.Util.pagePosition(this.element);
this.element.offsets[0]+=this.element.scrolls[0];
this.element.offsets[1]+=this.element.scrolls[1]
}return new OpenLayers.Pixel((A.clientX+this.element.scrolls[0])-this.element.offsets[0]-this.element.lefttop[0],(A.clientY+this.element.scrolls[1])-this.element.offsets[1]-this.element.lefttop[1])
},CLASS_NAME:"OpenLayers.Events"});OpenLayers.Projection=OpenLayers.Class({proj:null,projCode:null,initialize:function(B,A){OpenLayers.Util.extend(this,A);
this.projCode=B;
if(window.Proj4js){this.proj=new Proj4js.Proj(B)
}},getCode:function(){return this.proj?this.proj.srsCode:this.projCode
},getUnits:function(){return this.proj?this.proj.units:null
},toString:function(){return this.getCode()
},equals:function(A){if(A&&A.getCode){return this.getCode()==A.getCode()
}else{return false
}},destroy:function(){delete this.proj;
delete this.projCode
},CLASS_NAME:"OpenLayers.Projection"});
OpenLayers.Projection.transforms={};
OpenLayers.Projection.addTransform=function(C,B,A){if(!OpenLayers.Projection.transforms[C]){OpenLayers.Projection.transforms[C]={}
}OpenLayers.Projection.transforms[C][B]=A
};
OpenLayers.Projection.transform=function(A,C,B){if(C.proj&&B.proj){A=Proj4js.transform(C.proj,B.proj,A)
}else{if(C&&B&&OpenLayers.Projection.transforms[C.getCode()]&&OpenLayers.Projection.transforms[C.getCode()][B.getCode()]){OpenLayers.Projection.transforms[C.getCode()][B.getCode()](A)
}}return A
};OpenLayers.Map=OpenLayers.Class({Z_INDEX_BASE:{BaseLayer:100,Overlay:325,Feature:725,Popup:750,Control:1000},EVENT_TYPES:["preaddlayer","addlayer","removelayer","changelayer","movestart","move","moveend","zoomend","popupopen","popupclose","addmarker","removemarker","clearmarkers","mouseover","mouseout","mousemove","dragstart","drag","dragend","changebaselayer"],id:null,fractionalZoom:false,events:null,div:null,dragging:false,size:null,viewPortDiv:null,layerContainerOrigin:null,layerContainerDiv:null,layers:null,controls:null,popups:null,baseLayer:null,center:null,resolution:null,zoom:0,panRatio:1.5,viewRequestID:0,tileSize:null,projection:"EPSG:4326",units:"degrees",resolutions:null,maxResolution:1.40625,minResolution:null,maxScale:null,minScale:null,maxExtent:null,minExtent:null,restrictedExtent:null,numZoomLevels:16,theme:null,displayProjection:null,fallThrough:true,panTween:null,eventListeners:null,panMethod:OpenLayers.Easing.Expo.easeOut,paddingForPopups:null,initialize:function(H,D){this.tileSize=new OpenLayers.Size(OpenLayers.Map.TILE_WIDTH,OpenLayers.Map.TILE_HEIGHT);
this.maxExtent=new OpenLayers.Bounds(-180,-90,180,90);
this.paddingForPopups=new OpenLayers.Bounds(15,15,15,15);
this.theme=OpenLayers._getScriptLocation()+"theme/default/style.css";
OpenLayers.Util.extend(this,D);
this.id=OpenLayers.Util.createUniqueID("OpenLayers.Map_");
this.div=OpenLayers.Util.getElement(H);
OpenLayers.Element.addClass(this.div,"olMap");
var G=this.div.id+"_OpenLayers_ViewPort";
this.viewPortDiv=OpenLayers.Util.createDiv(G,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);
G=this.div.id+"_OpenLayers_Container";
this.layerContainerDiv=OpenLayers.Util.createDiv(G);
this.layerContainerDiv.style.zIndex=this.Z_INDEX_BASE.Popup-1;
this.viewPortDiv.appendChild(this.layerContainerDiv);
this.events=new OpenLayers.Events(this,this.div,this.EVENT_TYPES,this.fallThrough,{includeXY:true});
this.updateSize();
if(this.eventListeners instanceof Object){this.events.on(this.eventListeners)
}this.events.register("movestart",this,this.updateSize);
if(OpenLayers.String.contains(navigator.appName,"Microsoft")){this.events.register("resize",this,this.updateSize)
}else{this.updateSizeDestroy=OpenLayers.Function.bind(this.updateSize,this);
OpenLayers.Event.observe(window,"resize",this.updateSizeDestroy)
}if(this.theme){var F=true;
var C=document.getElementsByTagName("link");
for(var E=0,A=C.length;
E<A;
++E){if(OpenLayers.Util.isEquivalentUrl(C.item(E).href,this.theme)){F=false;
break
}}if(F){var B=document.createElement("link");
B.setAttribute("rel","stylesheet");
B.setAttribute("type","text/css");
B.setAttribute("href",this.theme);
document.getElementsByTagName("head")[0].appendChild(B)
}}this.layers=[];
if(this.controls==null){if(OpenLayers.Control!=null){this.controls=[new OpenLayers.Control.Navigation(),new OpenLayers.Control.PanZoom(),new OpenLayers.Control.ArgParser(),new OpenLayers.Control.Attribution()]
}else{this.controls=[]
}}for(var E=0,A=this.controls.length;
E<A;
E++){this.addControlToMap(this.controls[E])
}this.popups=[];
this.unloadDestroy=OpenLayers.Function.bind(this.destroy,this);
OpenLayers.Event.observe(window,"unload",this.unloadDestroy)
},unloadDestroy:null,updateSizeDestroy:null,destroy:function(){if(!this.unloadDestroy){return false
}OpenLayers.Event.stopObserving(window,"unload",this.unloadDestroy);
this.unloadDestroy=null;
if(this.updateSizeDestroy){OpenLayers.Event.stopObserving(window,"resize",this.updateSizeDestroy)
}else{this.events.unregister("resize",this,this.updateSize)
}this.paddingForPopups=null;
if(this.controls!=null){for(var A=this.controls.length-1;
A>=0;
--A){this.controls[A].destroy()
}this.controls=null
}if(this.layers!=null){for(var A=this.layers.length-1;
A>=0;
--A){this.layers[A].destroy(false)
}this.layers=null
}if(this.viewPortDiv){this.div.removeChild(this.viewPortDiv)
}this.viewPortDiv=null;
if(this.eventListeners){this.events.un(this.eventListeners);
this.eventListeners=null
}this.events.destroy();
this.events=null
},setOptions:function(A){OpenLayers.Util.extend(this,A)
},getTileSize:function(){return this.tileSize
},getBy:function(E,C,A){var D=(typeof A.test=="function");
var B=OpenLayers.Array.filter(this[E],function(F){return F[C]==A||(D&&A.test(F[C]))
});
return B
},getLayersBy:function(B,A){return this.getBy("layers",B,A)
},getLayersByName:function(A){return this.getLayersBy("name",A)
},getLayersByClass:function(A){return this.getLayersBy("CLASS_NAME",A)
},getControlsBy:function(B,A){return this.getBy("controls",B,A)
},getControlsByClass:function(A){return this.getControlsBy("CLASS_NAME",A)
},getLayer:function(E){var B=null;
for(var D=0,A=this.layers.length;
D<A;
D++){var C=this.layers[D];
if(C.id==E){B=C;
break
}}return B
},setLayerZIndex:function(B,A){B.setZIndex(this.Z_INDEX_BASE[B.isBaseLayer?"BaseLayer":"Overlay"]+A*5)
},resetLayersZIndex:function(){for(var C=0,A=this.layers.length;
C<A;
C++){var B=this.layers[C];
this.setLayerZIndex(B,C)
}},addLayer:function(C){for(var B=0,A=this.layers.length;
B<A;
B++){if(this.layers[B]==C){var D=OpenLayers.i18n("layerAlreadyAdded",{layerName:C.name});
OpenLayers.Console.warn(D);
return false
}}this.events.triggerEvent("preaddlayer",{layer:C});
C.div.className="olLayerDiv";
C.div.style.overflow="";
this.setLayerZIndex(C,this.layers.length);
if(C.isFixed){this.viewPortDiv.appendChild(C.div)
}else{this.layerContainerDiv.appendChild(C.div)
}this.layers.push(C);
C.setMap(this);
if(C.isBaseLayer){if(this.baseLayer==null){this.setBaseLayer(C)
}else{C.setVisibility(false)
}}else{C.redraw()
}this.events.triggerEvent("addlayer",{layer:C})
},addLayers:function(C){for(var B=0,A=C.length;
B<A;
B++){this.addLayer(C[B])
}},removeLayer:function(C,E){if(E==null){E=true
}if(C.isFixed){this.viewPortDiv.removeChild(C.div)
}else{this.layerContainerDiv.removeChild(C.div)
}OpenLayers.Util.removeItem(this.layers,C);
C.removeMap(this);
C.map=null;
if(this.baseLayer==C){this.baseLayer=null;
if(E){for(var B=0,A=this.layers.length;
B<A;
B++){var D=this.layers[B];
if(D.isBaseLayer){this.setBaseLayer(D);
break
}}}}this.resetLayersZIndex();
this.events.triggerEvent("removelayer",{layer:C})
},getNumLayers:function(){return this.layers.length
},getLayerIndex:function(A){return OpenLayers.Util.indexOf(this.layers,A)
},setLayerIndex:function(D,B){var E=this.getLayerIndex(D);
if(B<0){B=0
}else{if(B>this.layers.length){B=this.layers.length
}}if(E!=B){this.layers.splice(E,1);
this.layers.splice(B,0,D);
for(var C=0,A=this.layers.length;
C<A;
C++){this.setLayerZIndex(this.layers[C],C)
}this.events.triggerEvent("changelayer",{layer:D,property:"order"})
}},raiseLayer:function(B,C){var A=this.getLayerIndex(B)+C;
this.setLayerIndex(B,A)
},setBaseLayer:function(E){var D=null;
if(this.baseLayer){D=this.baseLayer.getExtent()
}if(E!=this.baseLayer){if(OpenLayers.Util.indexOf(this.layers,E)!=-1){if(this.baseLayer!=null){this.baseLayer.setVisibility(false)
}this.baseLayer=E;
this.viewRequestID++;
this.baseLayer.visibility=true;
var A=this.getCenter();
if(A!=null){var B=(D)?D.getCenterLonLat():A;
var C=(D)?this.getZoomForExtent(D,true):this.getZoomForResolution(this.resolution,true);
this.setCenter(B,C,false,true)
}this.events.triggerEvent("changebaselayer",{layer:this.baseLayer})
}}},addControl:function(B,A){this.controls.push(B);
this.addControlToMap(B,A)
},addControlToMap:function(B,A){B.outsideViewport=(B.div!=null);
if(this.displayProjection&&!B.displayProjection){B.displayProjection=this.displayProjection
}B.setMap(this);
var C=B.draw(A);
if(C){if(!B.outsideViewport){C.style.zIndex=this.Z_INDEX_BASE.Control+this.controls.length;
this.viewPortDiv.appendChild(C)
}}},getControl:function(E){var B=null;
for(var C=0,A=this.controls.length;
C<A;
C++){var D=this.controls[C];
if(D.id==E){B=D;
break
}}return B
},removeControl:function(A){if((A)&&(A==this.getControl(A.id))){if(A.div&&(A.div.parentNode==this.viewPortDiv)){this.viewPortDiv.removeChild(A.div)
}OpenLayers.Util.removeItem(this.controls,A)
}},addPopup:function(A,D){if(D){for(var B=this.popups.length-1;
B>=0;
--B){this.removePopup(this.popups[B])
}}A.map=this;
this.popups.push(A);
var C=A.draw();
if(C){C.style.zIndex=this.Z_INDEX_BASE.Popup+this.popups.length;
this.layerContainerDiv.appendChild(C)
}},removePopup:function(A){OpenLayers.Util.removeItem(this.popups,A);
if(A.div){try{this.layerContainerDiv.removeChild(A.div)
}catch(B){}}A.map=null
},getSize:function(){var A=null;
if(this.size!=null){A=this.size.clone()
}return A
},updateSize:function(){this.events.clearMouseCache();
var C=this.getCurrentSize();
var F=this.getSize();
if(F==null){this.size=F=C
}if(!C.equals(F)){this.size=C;
for(var D=0,B=this.layers.length;
D<B;
D++){this.layers[D].onMapResize()
}if(this.baseLayer!=null){var A=new OpenLayers.Pixel(C.w/2,C.h/2);
var G=this.getLonLatFromViewPortPx(A);
var E=this.getZoom();
this.zoom=null;
this.setCenter(this.getCenter(),E)
}}},getCurrentSize:function(){var A=new OpenLayers.Size(this.div.clientWidth,this.div.clientHeight);
if(A.w==0&&A.h==0||isNaN(A.w)&&isNaN(A.h)){var B=OpenLayers.Element.getDimensions(this.div);
A.w=B.width;
A.h=B.height
}if(A.w==0&&A.h==0||isNaN(A.w)&&isNaN(A.h)){A.w=parseInt(this.div.style.width);
A.h=parseInt(this.div.style.height)
}return A
},calculateBounds:function(A,B){var E=null;
if(A==null){A=this.getCenter()
}if(B==null){B=this.getResolution()
}if((A!=null)&&(B!=null)){var D=this.getSize();
var F=D.w*B;
var C=D.h*B;
E=new OpenLayers.Bounds(A.lon-F/2,A.lat-C/2,A.lon+F/2,A.lat+C/2)
}return E
},getCenter:function(){return this.center
},getZoom:function(){return this.zoom
},pan:function(D,C,E){E=OpenLayers.Util.applyDefaults(E,{animate:true,dragging:false});
var F=this.getViewPortPxFromLonLat(this.getCenter());
var B=F.add(D,C);
if(!E.dragging||!B.equals(F)){var A=this.getLonLatFromViewPortPx(B);
if(E.animate){this.panTo(A)
}else{this.setCenter(A,null,E.dragging)
}}},panTo:function(B){if(this.panMethod&&this.getExtent().scale(this.panRatio).containsLonLat(B)){if(!this.panTween){this.panTween=new OpenLayers.Tween(this.panMethod)
}var A=this.getCenter();
if(B.lon==A.lon&&B.lat==A.lat){return 
}var D={lon:A.lon,lat:A.lat};
var C={lon:B.lon,lat:B.lat};
this.panTween.start(D,C,50,{callbacks:{start:OpenLayers.Function.bind(function(E){this.events.triggerEvent("movestart")
},this),eachStep:OpenLayers.Function.bind(function(E){E=new OpenLayers.LonLat(E.lon,E.lat);
this.moveTo(E,this.zoom,{dragging:true,noEvent:true})
},this),done:OpenLayers.Function.bind(function(E){E=new OpenLayers.LonLat(E.lon,E.lat);
this.moveTo(E,this.zoom,{noEvent:true});
this.events.triggerEvent("moveend")
},this)}})
}else{this.setCenter(B)
}},setCenter:function(C,A,B,D){this.moveTo(C,A,{dragging:B,forceZoomChange:D,caller:"setCenter"})
},moveTo:function(G,M,P){if(!P){P={}
}var L=P.dragging;
var C=P.forceZoomChange;
var H=P.noEvent;
if(this.panTween&&P.caller=="setCenter"){this.panTween.stop()
}if(!this.center&&!this.isValidLonLat(G)){G=this.maxExtent.getCenterLonLat()
}if(this.restrictedExtent!=null){if(G==null){G=this.getCenter()
}if(M==null){M=this.getZoom()
}var D=this.getResolutionForZoom(M);
var N=this.calculateBounds(G,D);
if(!this.restrictedExtent.containsBounds(N)){var O=this.restrictedExtent.getCenterLonLat();
if(N.getWidth()>this.restrictedExtent.getWidth()){G=new OpenLayers.LonLat(O.lon,G.lat)
}else{if(N.left<this.restrictedExtent.left){G=G.add(this.restrictedExtent.left-N.left,0)
}else{if(N.right>this.restrictedExtent.right){G=G.add(this.restrictedExtent.right-N.right,0)
}}}if(N.getHeight()>this.restrictedExtent.getHeight()){G=new OpenLayers.LonLat(G.lon,O.lat)
}else{if(N.bottom<this.restrictedExtent.bottom){G=G.add(0,this.restrictedExtent.bottom-N.bottom)
}else{if(N.top>this.restrictedExtent.top){G=G.add(0,this.restrictedExtent.top-N.top)
}}}}}var B=C||((this.isValidZoomLevel(M))&&(M!=this.getZoom()));
var E=(this.isValidLonLat(G))&&(!G.equals(this.center));
if(B||E||!L){if(!this.dragging&&!H){this.events.triggerEvent("movestart")
}if(E){if((!B)&&(this.center)){this.centerLayerContainer(G)
}this.center=G.clone()
}if((B)||(this.layerContainerOrigin==null)){this.layerContainerOrigin=this.center.clone();
this.layerContainerDiv.style.left="0px";
this.layerContainerDiv.style.top="0px"
}if(B){this.zoom=M;
this.resolution=this.getResolutionForZoom(M);
this.viewRequestID++
}var A=this.getExtent();
this.baseLayer.moveTo(A,B,L);
A=this.baseLayer.getExtent();
for(var F=0,J=this.layers.length;
F<J;
F++){var I=this.layers[F];
if(!I.isBaseLayer){var K=I.calculateInRange();
if(I.inRange!=K){I.inRange=K;
if(!K){I.display(false)
}this.events.triggerEvent("changelayer",{layer:I,property:"visibility"})
}if(K&&I.visibility){I.moveTo(A,B,L);
I.events.triggerEvent("moveend",{zoomChanged:B})
}}}if(B){for(var F=0,J=this.popups.length;
F<J;
F++){this.popups[F].updatePosition()
}}this.events.triggerEvent("move");
if(B){this.events.triggerEvent("zoomend")
}}if(!L&&!H){this.events.triggerEvent("moveend")
}this.dragging=!!L
},centerLayerContainer:function(B){var A=this.getViewPortPxFromLonLat(this.layerContainerOrigin);
var C=this.getViewPortPxFromLonLat(B);
if((A!=null)&&(C!=null)){this.layerContainerDiv.style.left=Math.round(A.x-C.x)+"px";
this.layerContainerDiv.style.top=Math.round(A.y-C.y)+"px"
}},isValidZoomLevel:function(A){return((A!=null)&&(A>=0)&&(A<this.getNumZoomLevels()))
},isValidLonLat:function(C){var B=false;
if(C!=null){var A=this.getMaxExtent();
B=A.containsLonLat(C)
}return B
},getProjection:function(){var A=this.getProjectionObject();
return A?A.getCode():null
},getProjectionObject:function(){var A=null;
if(this.baseLayer!=null){A=this.baseLayer.projection
}return A
},getMaxResolution:function(){var A=null;
if(this.baseLayer!=null){A=this.baseLayer.maxResolution
}return A
},getMaxExtent:function(B){var A=null;
if(B&&B.restricted&&this.restrictedExtent){A=this.restrictedExtent
}else{if(this.baseLayer!=null){A=this.baseLayer.maxExtent
}}return A
},getNumZoomLevels:function(){var A=null;
if(this.baseLayer!=null){A=this.baseLayer.numZoomLevels
}return A
},getExtent:function(){var A=null;
if(this.baseLayer!=null){A=this.baseLayer.getExtent()
}return A
},getResolution:function(){var A=null;
if(this.baseLayer!=null){A=this.baseLayer.getResolution()
}return A
},getUnits:function(){var A=null;
if(this.baseLayer!=null){A=this.baseLayer.units
}return A
},getScale:function(){var C=null;
if(this.baseLayer!=null){var B=this.getResolution();
var A=this.baseLayer.units;
C=OpenLayers.Util.getScaleFromResolution(B,A)
}return C
},getZoomForExtent:function(C,B){var A=null;
if(this.baseLayer!=null){A=this.baseLayer.getZoomForExtent(C,B)
}return A
},getResolutionForZoom:function(B){var A=null;
if(this.baseLayer){A=this.baseLayer.getResolutionForZoom(B)
}return A
},getZoomForResolution:function(A,C){var B=null;
if(this.baseLayer!=null){B=this.baseLayer.getZoomForResolution(A,C)
}return B
},zoomTo:function(A){if(this.isValidZoomLevel(A)){this.setCenter(null,A)
}},zoomIn:function(){this.zoomTo(this.getZoom()+1)
},zoomOut:function(){this.zoomTo(this.getZoom()-1)
},zoomToExtent:function(D,C){var B=D.getCenterLonLat();
if(this.baseLayer.wrapDateLine){var A=this.getMaxExtent();
D=D.clone();
while(D.right<D.left){D.right+=A.getWidth()
}B=D.getCenterLonLat().wrapDateLine(A)
}this.setCenter(B,this.getZoomForExtent(D,C))
},zoomToMaxExtent:function(C){var B=(C)?C.restricted:true;
var A=this.getMaxExtent({restricted:B});
this.zoomToExtent(A)
},zoomToScale:function(H,G){var D=OpenLayers.Util.getResolutionFromScale(H,this.baseLayer.units);
var C=this.getSize();
var F=C.w*D;
var B=C.h*D;
var A=this.getCenter();
var E=new OpenLayers.Bounds(A.lon-F/2,A.lat-B/2,A.lon+F/2,A.lat+B/2);
this.zoomToExtent(E,G)
},getLonLatFromViewPortPx:function(A){var B=null;
if(this.baseLayer!=null){B=this.baseLayer.getLonLatFromViewPortPx(A)
}return B
},getViewPortPxFromLonLat:function(B){var A=null;
if(this.baseLayer!=null){A=this.baseLayer.getViewPortPxFromLonLat(B)
}return A
},getLonLatFromPixel:function(A){return this.getLonLatFromViewPortPx(A)
},getPixelFromLonLat:function(B){var A=this.getViewPortPxFromLonLat(B);
A.x=Math.round(A.x);
A.y=Math.round(A.y);
return A
},getViewPortPxFromLayerPx:function(D){var C=null;
if(D!=null){var B=parseInt(this.layerContainerDiv.style.left);
var A=parseInt(this.layerContainerDiv.style.top);
C=D.add(B,A)
}return C
},getLayerPxFromViewPortPx:function(C){var D=null;
if(C!=null){var B=-parseInt(this.layerContainerDiv.style.left);
var A=-parseInt(this.layerContainerDiv.style.top);
D=C.add(B,A);
if(isNaN(D.x)||isNaN(D.y)){D=null
}}return D
},getLonLatFromLayerPx:function(A){A=this.getViewPortPxFromLayerPx(A);
return this.getLonLatFromViewPortPx(A)
},getLayerPxFromLonLat:function(B){var A=this.getPixelFromLonLat(B);
return this.getLayerPxFromViewPortPx(A)
},CLASS_NAME:"OpenLayers.Map"});
OpenLayers.Map.TILE_WIDTH=256;
OpenLayers.Map.TILE_HEIGHT=256;OpenLayers.Layer=OpenLayers.Class({id:null,name:null,div:null,opacity:null,alwaysInRange:null,EVENT_TYPES:["loadstart","loadend","loadcancel","visibilitychanged","moveend"],events:null,map:null,isBaseLayer:false,alpha:false,displayInLayerSwitcher:true,visibility:true,attribution:null,inRange:false,imageSize:null,imageOffset:null,options:null,eventListeners:null,gutter:0,projection:null,units:null,scales:null,resolutions:null,maxExtent:null,minExtent:null,maxResolution:null,minResolution:null,numZoomLevels:null,minScale:null,maxScale:null,displayOutsideMaxExtent:false,wrapDateLine:false,transitionEffect:null,SUPPORTED_TRANSITIONS:["resize"],initialize:function(B,A){this.addOptions(A);
this.name=B;
if(this.id==null){this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_");
this.div=OpenLayers.Util.createDiv(this.id);
this.div.style.width="100%";
this.div.style.height="100%";
this.events=new OpenLayers.Events(this,this.div,this.EVENT_TYPES);
if(this.eventListeners instanceof Object){this.events.on(this.eventListeners)
}}if(this.wrapDateLine){this.displayOutsideMaxExtent=true
}},destroy:function(A){if(A==null){A=true
}if(this.map!=null){this.map.removeLayer(this,A)
}this.projection=null;
this.map=null;
this.name=null;
this.div=null;
this.options=null;
if(this.events){if(this.eventListeners){this.events.un(this.eventListeners)
}this.events.destroy()
}this.eventListeners=null;
this.events=null
},clone:function(A){if(A==null){A=new OpenLayers.Layer(this.name,this.options)
}OpenLayers.Util.applyDefaults(A,this);
A.map=null;
return A
},setName:function(A){if(A!=this.name){this.name=A;
if(this.map!=null){this.map.events.triggerEvent("changelayer",{layer:this,property:"name"})
}}},addOptions:function(A){if(this.options==null){this.options={}
}OpenLayers.Util.extend(this.options,A);
OpenLayers.Util.extend(this,A)
},onMapResize:function(){},redraw:function(){var A=false;
if(this.map){this.inRange=this.calculateInRange();
var B=this.getExtent();
if(B&&this.inRange&&this.visibility){this.moveTo(B,true,false);
A=true
}}return A
},moveTo:function(B,A,C){var D=this.visibility;
if(!this.isBaseLayer){D=D&&this.inRange
}this.display(D)
},setMap:function(B){if(this.map==null){this.map=B;
this.maxExtent=this.maxExtent||this.map.maxExtent;
this.projection=this.projection||this.map.projection;
if(this.projection&&typeof this.projection=="string"){this.projection=new OpenLayers.Projection(this.projection)
}this.units=this.projection.getUnits()||this.units||this.map.units;
this.initResolutions();
if(!this.isBaseLayer){this.inRange=this.calculateInRange();
var A=((this.visibility)&&(this.inRange));
this.div.style.display=A?"":"none"
}this.setTileSize()
}},removeMap:function(A){},getImageSize:function(){return(this.imageSize||this.tileSize)
},setTileSize:function(A){var B=(A)?A:((this.tileSize)?this.tileSize:this.map.getTileSize());
this.tileSize=B;
if(this.gutter){this.imageOffset=new OpenLayers.Pixel(-this.gutter,-this.gutter);
this.imageSize=new OpenLayers.Size(B.w+(2*this.gutter),B.h+(2*this.gutter))
}},getVisibility:function(){return this.visibility
},setVisibility:function(A){if(A!=this.visibility){this.visibility=A;
this.display(A);
this.redraw();
if(this.map!=null){this.map.events.triggerEvent("changelayer",{layer:this,property:"visibility"})
}this.events.triggerEvent("visibilitychanged")
}},display:function(A){var B=this.calculateInRange();
if(A!=(this.div.style.display!="none")){this.div.style.display=(A&&B)?"block":"none"
}},calculateInRange:function(){var B=false;
if(this.alwaysInRange){B=true
}else{if(this.map){var A=this.map.getResolution();
B=((A>=this.minResolution)&&(A<=this.maxResolution))
}}return B
},setIsBaseLayer:function(A){if(A!=this.isBaseLayer){this.isBaseLayer=A;
if(this.map!=null){this.map.events.triggerEvent("changebaselayer",{layer:this})
}}},initResolutions:function(){var M=new Array("projection","units","scales","resolutions","maxScale","minScale","maxResolution","minResolution","minExtent","maxExtent","numZoomLevels","maxZoomLevel");
var B=["projection","units"];
var E=false;
var D={};
for(var F=0,I=M.length;
F<I;
F++){var O=M[F];
if(this.options[O]&&OpenLayers.Util.indexOf(B,O)==-1){E=true
}D[O]=this.options[O]||this.map[O]
}if(this.alwaysInRange==null){this.alwaysInRange=!E
}if((this.options.minScale!=null||this.options.maxScale!=null)&&this.options.scales==null){D.scales=null
}if((this.options.minResolution!=null||this.options.maxResolution!=null)&&this.options.resolutions==null){D.resolutions=null
}if((!D.numZoomLevels)&&(D.maxZoomLevel)){D.numZoomLevels=D.maxZoomLevel+1
}if((D.scales!=null)||(D.resolutions!=null)){if(D.scales!=null){D.resolutions=[];
for(var F=0,I=D.scales.length;
F<I;
F++){var C=D.scales[F];
D.resolutions[F]=OpenLayers.Util.getResolutionFromScale(C,D.units)
}}D.numZoomLevels=D.resolutions.length
}else{if(D.minScale){D.maxResolution=OpenLayers.Util.getResolutionFromScale(D.minScale,D.units)
}else{if(D.maxResolution=="auto"){var N=this.map.getSize();
var L=D.maxExtent.getWidth()/N.w;
var H=D.maxExtent.getHeight()/N.h;
D.maxResolution=Math.max(L,H)
}}if(D.maxScale!=null){D.minResolution=OpenLayers.Util.getResolutionFromScale(D.maxScale,D.units)
}else{if((D.minResolution=="auto")&&(D.minExtent!=null)){var N=this.map.getSize();
var L=D.minExtent.getWidth()/N.w;
var H=D.minExtent.getHeight()/N.h;
D.minResolution=Math.max(L,H)
}}if(D.minResolution!=null&&this.options.numZoomLevels==undefined){var K=D.maxResolution/D.minResolution;
D.numZoomLevels=Math.floor(Math.log(K)/Math.log(2))+1
}D.resolutions=new Array(D.numZoomLevels);
var A=2;
if(typeof D.minResolution=="number"&&D.numZoomLevels>1){A=Math.pow((D.maxResolution/D.minResolution),(1/(D.numZoomLevels-1)))
}for(var F=0;
F<D.numZoomLevels;
F++){var J=D.maxResolution/Math.pow(A,F);
D.resolutions[F]=J
}}D.resolutions.sort(function(Q,P){return(P-Q)
});
this.resolutions=D.resolutions;
this.maxResolution=D.resolutions[0];
var G=D.resolutions.length-1;
this.minResolution=D.resolutions[G];
this.scales=[];
for(var F=0,I=D.resolutions.length;
F<I;
F++){this.scales[F]=OpenLayers.Util.getScaleFromResolution(D.resolutions[F],D.units)
}this.minScale=this.scales[0];
this.maxScale=this.scales[this.scales.length-1];
this.numZoomLevels=D.numZoomLevels
},getResolution:function(){var A=this.map.getZoom();
return this.getResolutionForZoom(A)
},getExtent:function(){return this.map.calculateBounds()
},getZoomForExtent:function(B,C){var D=this.map.getSize();
var A=Math.max(B.getWidth()/D.w,B.getHeight()/D.h);
return this.getZoomForResolution(A,C)
},getDataExtent:function(){},getResolutionForZoom:function(C){C=Math.max(0,Math.min(C,this.resolutions.length-1));
var B;
if(this.map.fractionalZoom){var A=Math.floor(C);
var D=Math.ceil(C);
B=this.resolutions[D]+((C-A)*(this.resolutions[A]-this.resolutions[D]))
}else{B=this.resolutions[Math.round(C)]
}return B
},getZoomForResolution:function(E,A){var M;
if(this.map.fractionalZoom){var J=0;
var C=this.resolutions.length-1;
var D=this.resolutions[J];
var B=this.resolutions[C];
var I;
for(var F=0,G=this.resolutions.length;
F<G;
++F){I=this.resolutions[F];
if(I>=E){D=I;
J=F
}if(I<=E){B=I;
C=F;
break
}}var H=D-B;
if(H>0){M=J+((E-B)/H)
}else{M=J
}}else{var K;
var L=Number.POSITIVE_INFINITY;
for(var F=0,G=this.resolutions.length;
F<G;
F++){if(A){K=Math.abs(this.resolutions[F]-E);
if(K>L){break
}L=K
}else{if(this.resolutions[F]<E){break
}}}M=Math.max(0,F-1)
}return M
},getLonLatFromViewPortPx:function(B){var E=null;
if(B!=null){var D=this.map.getSize();
var A=this.map.getCenter();
if(A){var C=this.map.getResolution();
var G=B.x-(D.w/2);
var F=B.y-(D.h/2);
E=new OpenLayers.LonLat(A.lon+G*C,A.lat-F*C);
if(this.wrapDateLine){E=E.wrapDateLine(this.maxExtent)
}}}return E
},getViewPortPxFromLonLat:function(D){var B=null;
if(D!=null){var A=this.map.getResolution();
var C=this.map.getExtent();
B=new OpenLayers.Pixel((1/A*(D.lon-C.left)),(1/A*(C.top-D.lat)))
}return B
},setOpacity:function(B){if(B!=this.opacity){this.opacity=B;
for(var D=0,A=this.div.childNodes.length;
D<A;
++D){var C=this.div.childNodes[D].firstChild;
OpenLayers.Util.modifyDOMElement(C,null,null,null,null,null,null,B)
}}},getZIndex:function(){return this.div.style.zIndex
},setZIndex:function(A){this.div.style.zIndex=A
},adjustBounds:function(B){if(this.gutter){var A=this.gutter*this.map.getResolution();
B=new OpenLayers.Bounds(B.left-A,B.bottom-A,B.right+A,B.top+A)
}if(this.wrapDateLine){var C={rightTolerance:this.getResolution()};
B=B.wrapDateLine(this.maxExtent,C)
}return B
},CLASS_NAME:"OpenLayers.Layer"});OpenLayers.Icon=OpenLayers.Class({url:null,size:null,offset:null,calculateOffset:null,imageDiv:null,px:null,initialize:function(A,B,D,C){this.url=A;
this.size=(B)?B:new OpenLayers.Size(20,20);
this.offset=D?D:new OpenLayers.Pixel(-(this.size.w/2),-(this.size.h/2));
this.calculateOffset=C;
var E=OpenLayers.Util.createUniqueID("OL_Icon_");
this.imageDiv=OpenLayers.Util.createAlphaImageDiv(E)
},destroy:function(){OpenLayers.Event.stopObservingElement(this.imageDiv.firstChild);
this.imageDiv.innerHTML="";
this.imageDiv=null
},clone:function(){return new OpenLayers.Icon(this.url,this.size,this.offset,this.calculateOffset)
},setSize:function(A){if(A!=null){this.size=A
}this.draw()
},setUrl:function(A){if(A!=null){this.url=A
}this.draw()
},draw:function(A){OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,null,this.size,this.url,"absolute");
this.moveTo(A);
return this.imageDiv
},setOpacity:function(A){OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,null,null,null,null,null,null,A)
},moveTo:function(A){if(A!=null){this.px=A
}if(this.imageDiv!=null){if(this.px==null){this.display(false)
}else{if(this.calculateOffset){this.offset=this.calculateOffset(this.size)
}var B=this.px.offset(this.offset);
OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,B)
}}},display:function(A){this.imageDiv.style.display=(A)?"":"none"
},CLASS_NAME:"OpenLayers.Icon"});OpenLayers.Marker=OpenLayers.Class({icon:null,lonlat:null,events:null,map:null,initialize:function(C,B){this.lonlat=C;
var A=(B)?B:OpenLayers.Marker.defaultIcon();
if(this.icon==null){this.icon=A
}else{this.icon.url=A.url;
this.icon.size=A.size;
this.icon.offset=A.offset;
this.icon.calculateOffset=A.calculateOffset
}this.events=new OpenLayers.Events(this,this.icon.imageDiv,null)
},destroy:function(){this.map=null;
this.events.destroy();
this.events=null;
if(this.icon!=null){this.icon.destroy();
this.icon=null
}},draw:function(A){return this.icon.draw(A)
},moveTo:function(A){if((A!=null)&&(this.icon!=null)){this.icon.moveTo(A)
}this.lonlat=this.map.getLonLatFromLayerPx(A)
},onScreen:function(){var B=false;
if(this.map){var A=this.map.getExtent();
B=A.containsLonLat(this.lonlat)
}return B
},inflate:function(B){if(this.icon){var A=new OpenLayers.Size(this.icon.size.w*B,this.icon.size.h*B);
this.icon.setSize(A)
}},setOpacity:function(A){this.icon.setOpacity(A)
},setUrl:function(A){this.icon.setUrl(A)
},display:function(A){this.icon.display(A)
},CLASS_NAME:"OpenLayers.Marker"});
OpenLayers.Marker.defaultIcon=function(){var A=OpenLayers.Util.getImagesLocation()+"marker.png";
var B=new OpenLayers.Size(21,25);
var C=function(D){return new OpenLayers.Pixel(-(D.w/2),-D.h)
};
return new OpenLayers.Icon(A,B,null,C)
};OpenLayers.Marker.Box=OpenLayers.Class(OpenLayers.Marker,{bounds:null,div:null,initialize:function(B,C,A){this.bounds=B;
this.div=OpenLayers.Util.createDiv();
this.div.style.overflow="hidden";
this.events=new OpenLayers.Events(this,this.div,null);
this.setBorder(C,A)
},destroy:function(){this.bounds=null;
this.div=null;
OpenLayers.Marker.prototype.destroy.apply(this,arguments)
},setBorder:function(A,B){if(!A){A="red"
}if(!B){B=2
}this.div.style.border=B+"px solid "+A
},draw:function(A,B){OpenLayers.Util.modifyDOMElement(this.div,null,A,B);
return this.div
},onScreen:function(){var B=false;
if(this.map){var A=this.map.getExtent();
B=A.containsBounds(this.bounds,true,true)
}return B
},display:function(A){this.div.style.display=(A)?"":"none"
},CLASS_NAME:"OpenLayers.Marker.Box"});OpenLayers.Popup=OpenLayers.Class({events:null,id:"",lonlat:null,div:null,contentSize:null,size:null,contentHTML:null,backgroundColor:"",opacity:"",border:"",contentDiv:null,groupDiv:null,closeDiv:null,autoSize:false,minSize:null,maxSize:null,displayClass:"olPopup",contentDisplayClass:"olPopupContent",padding:0,fixPadding:function(){if(typeof this.padding=="number"){this.padding=new OpenLayers.Bounds(this.padding,this.padding,this.padding,this.padding)
}},panMapIfOutOfView:false,map:null,initialize:function(G,C,F,B,E,D){if(G==null){G=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")
}this.id=G;
this.lonlat=C;
this.contentSize=(F!=null)?F:new OpenLayers.Size(OpenLayers.Popup.WIDTH,OpenLayers.Popup.HEIGHT);
if(B!=null){this.contentHTML=B
}this.backgroundColor=OpenLayers.Popup.COLOR;
this.opacity=OpenLayers.Popup.OPACITY;
this.border=OpenLayers.Popup.BORDER;
this.div=OpenLayers.Util.createDiv(this.id,null,null,null,null,null,"hidden");
this.div.className=this.displayClass;
var A=this.id+"_GroupDiv";
this.groupDiv=OpenLayers.Util.createDiv(A,null,null,null,"relative",null,"hidden");
var G=this.div.id+"_contentDiv";
this.contentDiv=OpenLayers.Util.createDiv(G,null,this.contentSize.clone(),null,"relative");
this.contentDiv.className=this.contentDisplayClass;
this.groupDiv.appendChild(this.contentDiv);
this.div.appendChild(this.groupDiv);
if(E){this.addCloseBox(D)
}this.registerEvents()
},destroy:function(){this.id=null;
this.lonlat=null;
this.size=null;
this.contentHTML=null;
this.backgroundColor=null;
this.opacity=null;
this.border=null;
this.events.destroy();
this.events=null;
if(this.closeDiv){OpenLayers.Event.stopObservingElement(this.closeDiv);
this.groupDiv.removeChild(this.closeDiv)
}this.closeDiv=null;
this.div.removeChild(this.groupDiv);
this.groupDiv=null;
if(this.map!=null){this.map.removePopup(this)
}this.map=null;
this.div=null;
this.autoSize=null;
this.minSize=null;
this.maxSize=null;
this.padding=null;
this.panMapIfOutOfView=null
},draw:function(A){if(A==null){if((this.lonlat!=null)&&(this.map!=null)){A=this.map.getLayerPxFromLonLat(this.lonlat)
}}if(OpenLayers.Util.getBrowserName()=="firefox"){this.map.events.register("movestart",this,function(){var B=document.defaultView.getComputedStyle(this.contentDiv,null);
var C=B.getPropertyValue("overflow");
if(C!="hidden"){this.contentDiv._oldOverflow=C;
this.contentDiv.style.overflow="hidden"
}});
this.map.events.register("moveend",this,function(){var B=this.contentDiv._oldOverflow;
if(B){this.contentDiv.style.overflow=B;
this.contentDiv._oldOverflow=null
}})
}this.moveTo(A);
if(!this.autoSize&&!this.size){this.setSize(this.contentSize)
}this.setBackgroundColor();
this.setOpacity();
this.setBorder();
this.setContentHTML();
if(this.panMapIfOutOfView){this.panIntoView()
}return this.div
},updatePosition:function(){if((this.lonlat)&&(this.map)){var A=this.map.getLayerPxFromLonLat(this.lonlat);
if(A){this.moveTo(A)
}}},moveTo:function(A){if((A!=null)&&(this.div!=null)){this.div.style.left=A.x+"px";
this.div.style.top=A.y+"px"
}},visible:function(){return OpenLayers.Element.visible(this.div)
},toggle:function(){if(this.visible()){this.hide()
}else{this.show()
}},show:function(){OpenLayers.Element.show(this.div);
if(this.panMapIfOutOfView){this.panIntoView()
}},hide:function(){OpenLayers.Element.hide(this.div)
},setSize:function(C){this.size=C.clone();
var B=this.getContentDivPadding();
var A=B.left+B.right;
var E=B.top+B.bottom;
this.fixPadding();
A+=this.padding.left+this.padding.right;
E+=this.padding.top+this.padding.bottom;
if(this.closeDiv){var D=parseInt(this.closeDiv.style.width);
A+=D+B.right
}this.size.w+=A;
this.size.h+=E;
if(OpenLayers.Util.getBrowserName()=="msie"){this.contentSize.w+=B.left+B.right;
this.contentSize.h+=B.bottom+B.top
}if(this.div!=null){this.div.style.width=this.size.w+"px";
this.div.style.height=this.size.h+"px"
}if(this.contentDiv!=null){this.contentDiv.style.width=C.w+"px";
this.contentDiv.style.height=C.h+"px"
}},updateSize:function(){var E="<div class='"+this.contentDisplayClass+"'>"+this.contentDiv.innerHTML+"</div>";
var D=OpenLayers.Util.getRenderedDimensions(E,null,{displayClass:this.displayClass});
var B=this.getSafeContentSize(D);
var C=null;
if(B.equals(D)){C=D
}else{var H=new OpenLayers.Size();
H.w=(B.w<D.w)?B.w:null;
H.h=(B.h<D.h)?B.h:null;
if(H.w&&H.h){C=B
}else{var A=OpenLayers.Util.getRenderedDimensions(E,H,{displayClass:this.displayClass});
var G=OpenLayers.Element.getStyle(this.contentDiv,"overflow");
if((G!="hidden")&&(A.equals(B))){var F=OpenLayers.Util.getScrollbarWidth();
if(H.w){A.h+=F
}else{A.w+=F
}}C=this.getSafeContentSize(A)
}}this.setSize(C)
},setBackgroundColor:function(A){if(A!=undefined){this.backgroundColor=A
}if(this.div!=null){this.div.style.backgroundColor=this.backgroundColor
}},setOpacity:function(A){if(A!=undefined){this.opacity=A
}if(this.div!=null){this.div.style.opacity=this.opacity;
this.div.style.filter="alpha(opacity="+this.opacity*100+")"
}},setBorder:function(A){if(A!=undefined){this.border=A
}if(this.div!=null){this.div.style.border=this.border
}},setContentHTML:function(A){if(A!=null){this.contentHTML=A
}if((this.contentDiv!=null)&&(this.contentHTML!=null)&&(this.contentHTML!=this.contentDiv.innerHTML)){this.contentDiv.innerHTML=this.contentHTML;
if(this.autoSize){this.registerImageListeners();
this.updateSize()
}}},registerImageListeners:function(){var F=function(){this.popup.updateSize();
if(this.popup.visible()&&this.popup.panMapIfOutOfView){this.popup.panIntoView()
}OpenLayers.Event.stopObserving(this.img,"load",this.img._onImageLoad)
};
var B=jQuery("img",this.contentDiv);
for(var E=0,A=B.length;
E<A;
E++){var C=B[E];
if(C.width==0||C.height==0){var D={popup:this,img:C};
C._onImgLoad=OpenLayers.Function.bind(F,D);
OpenLayers.Event.observe(C,"load",C._onImgLoad)
}}},getSafeContentSize:function(B){var E=B.clone();
var D=this.getContentDivPadding();
var A=D.left+D.right;
var H=D.top+D.bottom;
this.fixPadding();
A+=this.padding.left+this.padding.right;
H+=this.padding.top+this.padding.bottom;
if(this.closeDiv){var G=parseInt(this.closeDiv.style.width);
A+=G+D.right
}if(this.minSize){E.w=Math.max(E.w,(this.minSize.w-A));
E.h=Math.max(E.h,(this.minSize.h-H))
}if(this.maxSize){E.w=Math.min(E.w,(this.maxSize.w-A));
E.h=Math.min(E.h,(this.maxSize.h-H))
}if(this.map&&this.map.size){var C=this.map.size.h-this.map.paddingForPopups.top-this.map.paddingForPopups.bottom-H;
var F=this.map.size.w-this.map.paddingForPopups.left-this.map.paddingForPopups.right-A;
E.w=Math.min(E.w,F);
E.h=Math.min(E.h,C)
}return E
},getContentDivPadding:function(){var A=this._contentDivPadding;
if(!A){this.div.style.display="none";
document.body.appendChild(this.div);
A=new OpenLayers.Bounds(OpenLayers.Element.getStyle(this.contentDiv,"padding-left"),OpenLayers.Element.getStyle(this.contentDiv,"padding-bottom"),OpenLayers.Element.getStyle(this.contentDiv,"padding-right"),OpenLayers.Element.getStyle(this.contentDiv,"padding-top"));
this._contentDivPadding=A;
document.body.removeChild(this.div);
this.div.style.display=""
}return A
},addCloseBox:function(C){this.closeDiv=OpenLayers.Util.createDiv(this.id+"_close",null,new OpenLayers.Size(17,17));
this.closeDiv.className="olPopupCloseBox";
var B=this.getContentDivPadding();
this.closeDiv.style.right=B.right+"px";
this.closeDiv.style.top=B.top+"px";
this.groupDiv.appendChild(this.closeDiv);
var A=C||function(D){this.hide();
OpenLayers.Event.stop(D)
};
OpenLayers.Event.observe(this.closeDiv,"click",OpenLayers.Function.bindAsEventListener(A,this))
},panIntoView:function(){var E=this.map.getSize();
var D=this.map.getViewPortPxFromLayerPx(new OpenLayers.Pixel(parseInt(this.div.style.left),parseInt(this.div.style.top)));
var C=D.clone();
if(D.x<this.map.paddingForPopups.left){C.x=this.map.paddingForPopups.left
}else{if((D.x+this.size.w)>(E.w-this.map.paddingForPopups.right)){C.x=E.w-this.map.paddingForPopups.right-this.size.w
}}if(D.y<this.map.paddingForPopups.top){C.y=this.map.paddingForPopups.top
}else{if((D.y+this.size.h)>(E.h-this.map.paddingForPopups.bottom)){C.y=E.h-this.map.paddingForPopups.bottom-this.size.h
}}var B=D.x-C.x;
var A=D.y-C.y;
this.map.pan(B,A)
},registerEvents:function(){this.events=new OpenLayers.Events(this,this.div,null,true);
this.events.on({mousedown:this.onmousedown,mousemove:this.onmousemove,mouseup:this.onmouseup,click:this.onclick,mouseout:this.onmouseout,dblclick:this.ondblclick,scope:this})
},onmousedown:function(A){this.mousedown=true;
OpenLayers.Event.stop(A,true)
},onmousemove:function(A){if(this.mousedown){OpenLayers.Event.stop(A,true)
}},onmouseup:function(A){if(this.mousedown){this.mousedown=false;
OpenLayers.Event.stop(A,true)
}},onclick:function(A){OpenLayers.Event.stop(A,true)
},onmouseout:function(A){this.mousedown=false
},ondblclick:function(A){OpenLayers.Event.stop(A,true)
},CLASS_NAME:"OpenLayers.Popup"});
OpenLayers.Popup.WIDTH=200;
OpenLayers.Popup.HEIGHT=200;
OpenLayers.Popup.COLOR="white";
OpenLayers.Popup.OPACITY=1;
OpenLayers.Popup.BORDER="0px";OpenLayers.Tile=OpenLayers.Class({EVENT_TYPES:["loadstart","loadend","reload","unload"],events:null,id:null,layer:null,url:null,bounds:null,size:null,position:null,isLoading:false,initialize:function(D,A,E,B,C){this.layer=D;
this.position=A.clone();
this.bounds=E.clone();
this.url=B;
this.size=C.clone();
this.id=OpenLayers.Util.createUniqueID("Tile_");
this.events=new OpenLayers.Events(this,null,this.EVENT_TYPES)
},unload:function(){if(this.isLoading){this.isLoading=false;
this.events.triggerEvent("unload")
}},destroy:function(){this.layer=null;
this.bounds=null;
this.size=null;
this.position=null;
this.events.destroy();
this.events=null
},clone:function(A){if(A==null){A=new OpenLayers.Tile(this.layer,this.position,this.bounds,this.url,this.size)
}OpenLayers.Util.applyDefaults(A,this);
return A
},draw:function(){var A=this.layer.maxExtent;
var B=(A&&this.bounds.intersectsBounds(A,false));
this.shouldDraw=(B||this.layer.displayOutsideMaxExtent);
this.clear();
return this.shouldDraw
},moveTo:function(B,A,C){if(C==null){C=true
}this.bounds=B.clone();
this.position=A.clone();
if(C){this.draw()
}},clear:function(){},getBoundsFromBaseLayer:function(A){var F=OpenLayers.i18n("reprojectDeprecated",{layerName:this.layer.name});
OpenLayers.Console.warn(F);
var D=this.layer.map.getLonLatFromLayerPx(A);
var C=A.clone();
C.x+=this.size.w;
C.y+=this.size.h;
var B=this.layer.map.getLonLatFromLayerPx(C);
if(D.lon>B.lon){if(D.lon<0){D.lon=-180-(D.lon+180)
}else{B.lon=180+B.lon+180
}}var E=new OpenLayers.Bounds(D.lon,B.lat,B.lon,D.lat);
return E
},showTile:function(){if(this.shouldDraw){this.show()
}},show:function(){},hide:function(){},CLASS_NAME:"OpenLayers.Tile"});OpenLayers.Tile.Image=OpenLayers.Class(OpenLayers.Tile,{url:null,imgDiv:null,frame:null,layerAlphaHack:null,isBackBuffer:false,lastRatio:1,isFirstDraw:true,backBufferTile:null,initialize:function(D,A,E,B,C){OpenLayers.Tile.prototype.initialize.apply(this,arguments);
this.url=B;
this.frame=document.createElement("div");
this.frame.style.overflow="hidden";
this.frame.style.position="absolute";
this.layerAlphaHack=this.layer.alpha&&OpenLayers.Util.alphaHack()
},destroy:function(){if(this.imgDiv!=null){if(this.layerAlphaHack){OpenLayers.Event.stopObservingElement(this.imgDiv.childNodes[0].id)
}else{OpenLayers.Event.stopObservingElement(this.imgDiv.id)
}if(this.imgDiv.parentNode==this.frame){this.frame.removeChild(this.imgDiv);
this.imgDiv.map=null
}this.imgDiv.urls=null
}this.imgDiv=null;
if((this.frame!=null)&&(this.frame.parentNode==this.layer.div)){this.layer.div.removeChild(this.frame)
}this.frame=null;
if(this.backBufferTile){this.backBufferTile.destroy();
this.backBufferTile=null
}this.layer.events.unregister("loadend",this,this.resetBackBuffer);
OpenLayers.Tile.prototype.destroy.apply(this,arguments)
},clone:function(A){if(A==null){A=new OpenLayers.Tile.Image(this.layer,this.position,this.bounds,this.url,this.size)
}A=OpenLayers.Tile.prototype.clone.apply(this,[A]);
A.imgDiv=null;
return A
},draw:function(){if(this.layer!=this.layer.map.baseLayer&&this.layer.reproject){this.bounds=this.getBoundsFromBaseLayer(this.position)
}var A=OpenLayers.Tile.prototype.draw.apply(this,arguments);
if(OpenLayers.Util.indexOf(this.layer.SUPPORTED_TRANSITIONS,this.layer.transitionEffect)!=-1){if(A){if(!this.backBufferTile){this.backBufferTile=this.clone();
this.backBufferTile.hide();
this.backBufferTile.isBackBuffer=true;
this.events.register("loadend",this,this.resetBackBuffer);
this.layer.events.register("loadend",this,this.resetBackBuffer)
}this.startTransition()
}else{if(this.backBufferTile){this.backBufferTile.clear()
}}}else{if(A&&this.isFirstDraw){this.events.register("loadend",this,this.showTile);
this.isFirstDraw=false
}}if(!A){return false
}if(this.isLoading){this.events.triggerEvent("reload")
}else{this.isLoading=true;
this.events.triggerEvent("loadstart")
}return this.renderTile()
},resetBackBuffer:function(){this.showTile();
if(this.backBufferTile&&(this.isFirstDraw||!this.layer.numLoadingTiles)){this.isFirstDraw=false;
var A=this.layer.maxExtent;
var B=(A&&this.bounds.intersectsBounds(A,false));
if(B){this.backBufferTile.position=this.position;
this.backBufferTile.bounds=this.bounds;
this.backBufferTile.size=this.size;
this.backBufferTile.imageSize=this.layer.imageSize||this.size;
this.backBufferTile.imageOffset=this.layer.imageOffset;
this.backBufferTile.resolution=this.layer.getResolution();
this.backBufferTile.renderTile()
}}},renderTile:function(){if(this.imgDiv==null){this.initImgDiv()
}this.imgDiv.viewRequestID=this.layer.map.viewRequestID;
if(this.layer.url instanceof Array){this.imgDiv.urls=this.layer.url.slice()
}this.url=this.layer.getURL(this.bounds);
OpenLayers.Util.modifyDOMElement(this.frame,null,this.position,this.size);
var A=this.layer.getImageSize();
if(this.layerAlphaHack){OpenLayers.Util.modifyAlphaImageDiv(this.imgDiv,null,null,A,this.url)
}else{OpenLayers.Util.modifyDOMElement(this.imgDiv,null,null,A);
this.imgDiv.src=this.url
}return true
},clear:function(){if(this.imgDiv){this.hide();
if(OpenLayers.Tile.Image.useBlankTile){this.imgDiv.src=OpenLayers.Util.getImagesLocation()+"blank.gif"
}}},initImgDiv:function(){var D=this.layer.imageOffset;
var B=this.layer.getImageSize();
if(this.layerAlphaHack){this.imgDiv=OpenLayers.Util.createAlphaImageDiv(null,D,B,null,"relative",null,null,null,true)
}else{this.imgDiv=OpenLayers.Util.createImage(null,D,B,null,"relative",null,null,true)
}this.imgDiv.className="olTileImage";
this.frame.style.zIndex=this.isBackBuffer?0:1;
this.frame.appendChild(this.imgDiv);
this.layer.div.appendChild(this.frame);
if(this.layer.opacity!=null){OpenLayers.Util.modifyDOMElement(this.imgDiv,null,null,null,null,null,null,this.layer.opacity)
}this.imgDiv.map=this.layer.map;
var C=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(C,this))
}else{OpenLayers.Event.observe(this.imgDiv,"load",OpenLayers.Function.bind(C,this))
}var A=function(){if(this.imgDiv._attempts>OpenLayers.IMAGE_RELOAD_ATTEMPTS){C.call(this)
}};
OpenLayers.Event.observe(this.imgDiv,"error",OpenLayers.Function.bind(A,this))
},checkImgURL:function(){if(this.layer){var A=this.layerAlphaHack?this.imgDiv.firstChild.src:this.imgDiv.src;
if(!OpenLayers.Util.isEquivalentUrl(A,this.url)){this.hide()
}}},startTransition:function(){if(!this.backBufferTile||!this.backBufferTile.imgDiv){return 
}var D=1;
if(this.backBufferTile.resolution){D=this.backBufferTile.resolution/this.layer.getResolution()
}if(D!=this.lastRatio){if(this.layer.transitionEffect=="resize"){var C=new OpenLayers.LonLat(this.backBufferTile.bounds.left,this.backBufferTile.bounds.top);
var B=new OpenLayers.Size(this.backBufferTile.size.w*D,this.backBufferTile.size.h*D);
var A=this.layer.map.getLayerPxFromLonLat(C);
OpenLayers.Util.modifyDOMElement(this.backBufferTile.frame,null,A,B);
var E=this.backBufferTile.imageSize;
E=new OpenLayers.Size(E.w*D,E.h*D);
var F=this.backBufferTile.imageOffset;
if(F){F=new OpenLayers.Pixel(F.x*D,F.y*D)
}OpenLayers.Util.modifyDOMElement(this.backBufferTile.imgDiv,null,F,E);
this.backBufferTile.show()
}}else{if(this.layer.singleTile){this.backBufferTile.show()
}else{this.backBufferTile.hide()
}}this.lastRatio=D
},show:function(){this.frame.style.display="";
if(OpenLayers.Util.indexOf(this.layer.SUPPORTED_TRANSITIONS,this.layer.transitionEffect)!=-1){if(navigator.userAgent.toLowerCase().indexOf("gecko")!=-1){this.frame.scrollLeft=this.frame.scrollLeft
}}},hide:function(){this.frame.style.display="none"
},CLASS_NAME:"OpenLayers.Tile.Image"});
OpenLayers.Tile.Image.useBlankTile=(OpenLayers.Util.getBrowserName()=="safari"||OpenLayers.Util.getBrowserName()=="opera");OpenLayers.Tile.WFS=OpenLayers.Class(OpenLayers.Tile,{features:null,url:null,request:null,initialize:function(D,A,E,B,C){OpenLayers.Tile.prototype.initialize.apply(this,arguments);
this.url=B;
this.features=[]
},destroy:function(){OpenLayers.Tile.prototype.destroy.apply(this,arguments);
this.destroyAllFeatures();
this.features=null;
this.url=null;
if(this.request){this.request.abort();
this.request=null
}},clear:function(){this.destroyAllFeatures()
},draw:function(){if(OpenLayers.Tile.prototype.draw.apply(this,arguments)){if(this.isLoading){this.events.triggerEvent("reload")
}else{this.isLoading=true;
this.events.triggerEvent("loadstart")
}this.loadFeaturesForRegion(this.requestSuccess)
}},loadFeaturesForRegion:function(B,A){if(this.request){this.request.abort()
}this.request=OpenLayers.Request.GET({url:this.url,success:B,failure:A,scope:this})
},requestSuccess:function(B){if(this.features){var D=B.responseXML;
if(!D||!D.documentElement){D=B.responseText
}if(this.layer.vectorMode){this.layer.addFeatures(this.layer.formatObject.read(D))
}else{var A=new OpenLayers.Format.XML();
if(typeof D=="string"){D=A.read(D)
}var C=A.getElementsByTagNameNS(D,"http://www.opengis.net/gml","featureMember");
this.addResults(C)
}}if(this.events){this.events.triggerEvent("loadend")
}this.request=null
},addResults:function(C){for(var B=0;
B<C.length;
B++){var A=new this.layer.featureClass(this.layer,C[B]);
this.features.push(A)
}},destroyAllFeatures:function(){while(this.features.length>0){var A=this.features.shift();
A.destroy()
}},CLASS_NAME:"OpenLayers.Tile.WFS"});OpenLayers.Layer.Image=OpenLayers.Class(OpenLayers.Layer,{isBaseLayer:true,url:null,extent:null,size:null,tile:null,aspectRatio:null,initialize:function(C,B,E,D,A){this.url=B;
this.extent=E;
this.size=D;
OpenLayers.Layer.prototype.initialize.apply(this,[C,A]);
this.aspectRatio=(this.extent.getHeight()/this.size.h)/(this.extent.getWidth()/this.size.w)
},destroy:function(){if(this.tile){this.tile.destroy();
this.tile=null
}OpenLayers.Layer.prototype.destroy.apply(this,arguments)
},clone:function(A){if(A==null){A=new OpenLayers.Layer.Image(this.name,this.url,this.extent,this.size,this.options)
}A=OpenLayers.Layer.prototype.clone.apply(this,[A]);
return A
},setMap:function(A){if(this.options.maxResolution==null){this.options.maxResolution=this.aspectRatio*this.extent.getWidth()/this.size.w
}OpenLayers.Layer.prototype.setMap.apply(this,arguments)
},moveTo:function(E,A,F){OpenLayers.Layer.prototype.moveTo.apply(this,arguments);
var B=(this.tile==null);
if(A||B){this.setTileSize();
var D=new OpenLayers.LonLat(this.extent.left,this.extent.top);
var C=this.map.getLayerPxFromLonLat(D);
if(B){this.tile=new OpenLayers.Tile.Image(this,C,this.extent,null,this.tileSize)
}else{this.tile.size=this.tileSize.clone();
this.tile.position=C.clone()
}this.tile.draw()
}},setTileSize:function(){var B=this.extent.getWidth()/this.map.getResolution();
var A=this.extent.getHeight()/this.map.getResolution();
this.tileSize=new OpenLayers.Size(B,A)
},setUrl:function(A){this.url=A;
this.tile.draw()
},getURL:function(A){return this.url
},CLASS_NAME:"OpenLayers.Layer.Image"});OpenLayers.Layer.FixedZoomLevels=OpenLayers.Class({initialize:function(){},initResolutions:function(){var C=new Array("minZoomLevel","maxZoomLevel","numZoomLevels");
for(var B=0,A=C.length;
B<A;
B++){var F=C[B];
this[F]=(this.options[F]!=null)?this.options[F]:this.map[F]
}if((this.minZoomLevel==null)||(this.minZoomLevel<this.MIN_ZOOM_LEVEL)){this.minZoomLevel=this.MIN_ZOOM_LEVEL
}var G;
var E=this.MAX_ZOOM_LEVEL-this.minZoomLevel+1;
if(((this.options.numZoomLevels==null)&&(this.options.maxZoomLevel!=null))||((this.numZoomLevels==null)&&(this.maxZoomLevel!=null))){G=this.maxZoomLevel-this.minZoomLevel+1
}else{G=this.numZoomLevels
}if(G!=null){this.numZoomLevels=Math.min(G,E)
}else{this.numZoomLevels=E
}this.maxZoomLevel=this.minZoomLevel+this.numZoomLevels-1;
if(this.RESOLUTIONS!=null){var D=0;
this.resolutions=[];
for(var B=this.minZoomLevel;
B<=this.maxZoomLevel;
B++){this.resolutions[D++]=this.RESOLUTIONS[B]
}this.maxResolution=this.resolutions[0];
this.minResolution=this.resolutions[this.resolutions.length-1]
}},getResolution:function(){if(this.resolutions!=null){return OpenLayers.Layer.prototype.getResolution.apply(this,arguments)
}else{var A=null;
var C=this.map.getSize();
var B=this.getExtent();
if((C!=null)&&(B!=null)){A=Math.max(B.getWidth()/C.w,B.getHeight()/C.h)
}return A
}},getExtent:function(){var C=null;
var B=this.map.getSize();
var E=new OpenLayers.Pixel(0,0);
var F=this.getLonLatFromViewPortPx(E);
var A=new OpenLayers.Pixel(B.w,B.h);
var D=this.getLonLatFromViewPortPx(A);
if((F!=null)&&(D!=null)){C=new OpenLayers.Bounds(F.lon,D.lat,D.lon,F.lat)
}return C
},getZoomForResolution:function(A){if(this.resolutions!=null){return OpenLayers.Layer.prototype.getZoomForResolution.apply(this,arguments)
}else{var B=OpenLayers.Layer.prototype.getExtent.apply(this,[]);
return this.getZoomForExtent(B)
}},getOLZoomFromMapObjectZoom:function(A){var B=null;
if(A!=null){B=A-this.minZoomLevel
}return B
},getMapObjectZoomFromOLZoom:function(A){var B=null;
if(A!=null){B=A+this.minZoomLevel
}return B
},CLASS_NAME:"FixedZoomLevels.js"});OpenLayers.Layer.HTTPRequest=OpenLayers.Class(OpenLayers.Layer,{URL_HASH_FACTOR:(Math.sqrt(5)-1)/2,url:null,params:null,reproject:false,initialize:function(D,C,E,B){var A=arguments;
A=[D,B];
OpenLayers.Layer.prototype.initialize.apply(this,A);
this.url=C;
this.params=OpenLayers.Util.extend({},E)
},destroy:function(){this.url=null;
this.params=null;
OpenLayers.Layer.prototype.destroy.apply(this,arguments)
},clone:function(A){if(A==null){A=new OpenLayers.Layer.HTTPRequest(this.name,this.url,this.params,this.options)
}A=OpenLayers.Layer.prototype.clone.apply(this,[A]);
return A
},setUrl:function(A){this.url=A
},mergeNewParams:function(A){this.params=OpenLayers.Util.extend(this.params,A);
return this.redraw()
},redraw:function(A){if(A){return this.mergeNewParams({_olSalt:Math.random()})
}else{return OpenLayers.Layer.prototype.redraw.apply(this,[])
}},selectUrl:function(E,D){var C=1;
for(var B=0,A=E.length;
B<A;
B++){C*=E.charCodeAt(B)*this.URL_HASH_FACTOR;
C-=Math.floor(C)
}return D[Math.floor(C*D.length)]
},getFullRequestString:function(F,E){var B=E||this.url;
var G=OpenLayers.Util.extend({},this.params);
G=OpenLayers.Util.extend(G,F);
var A=OpenLayers.Util.getParameterString(G);
if(B instanceof Array){B=this.selectUrl(A,B)
}var D=OpenLayers.Util.upperCaseObject(OpenLayers.Util.getParameters(B));
for(var H in G){if(H.toUpperCase() in D){delete G[H]
}}A=OpenLayers.Util.getParameterString(G);
var I=B;
if(A!=""){var C=B.charAt(B.length-1);
if((C=="&")||(C=="?")){I+=A
}else{if(B.indexOf("?")==-1){I+="?"+A
}else{I+="&"+A
}}}return I
},CLASS_NAME:"OpenLayers.Layer.HTTPRequest"});OpenLayers.Layer.Grid=OpenLayers.Class(OpenLayers.Layer.HTTPRequest,{tileSize:null,grid:null,singleTile:false,ratio:1.5,buffer:2,numLoadingTiles:0,delayTileDrawing:false,loadSequence:0,initialize:function(C,B,D,A){OpenLayers.Layer.HTTPRequest.prototype.initialize.apply(this,arguments);
this.events.addEventType("tileloaded");
this.grid=[]
},destroy:function(){this.clearGrid();
this.grid=null;
this.tileSize=null;
OpenLayers.Layer.HTTPRequest.prototype.destroy.apply(this,arguments)
},clearGrid:function(){if(this.grid){for(var F=0,B=this.grid.length;
F<B;
F++){var E=this.grid[F];
for(var C=0,A=E.length;
C<A;
C++){var D=E[C];
this.removeTileMonitoringHooks(D);
D.destroy()
}}this.grid=[]
}},clone:function(A){if(A==null){A=new OpenLayers.Layer.Grid(this.name,this.url,this.params,this.options)
}A=OpenLayers.Layer.HTTPRequest.prototype.clone.apply(this,[A]);
if(this.tileSize!=null){A.tileSize=this.tileSize.clone()
}A.grid=[];
return A
},moveTo:function(D,A,E){OpenLayers.Layer.HTTPRequest.prototype.moveTo.apply(this,arguments);
D=D||this.map.getExtent();
if(D!=null){var C=!this.grid.length||A;
var B=this.getTilesBounds();
if(this.singleTile){if(C||(!E&&!B.containsBounds(D))){this.initSingleTile(D)
}}else{if(C||!B.containsBounds(D,true)){this.initGriddedTiles(D)
}else{this.moveGriddedTiles(D)
}}}},setTileSize:function(A){if(this.singleTile){A=this.map.getSize().clone();
A.h=parseInt(A.h*this.ratio);
A.w=parseInt(A.w*this.ratio)
}OpenLayers.Layer.HTTPRequest.prototype.setTileSize.apply(this,[A])
},getGridBounds:function(){var A="The getGridBounds() function is deprecated. It will be removed in 3.0. Please use getTilesBounds() instead.";
OpenLayers.Console.warn(A);
return this.getTilesBounds()
},getTilesBounds:function(){var E=null;
if(this.grid.length){var A=this.grid.length-1;
var D=this.grid[A][0];
var B=this.grid[0].length-1;
var C=this.grid[0][B];
E=new OpenLayers.Bounds(D.bounds.left,D.bounds.bottom,C.bounds.right,C.bounds.top)
}return E
},initSingleTile:function(F){var A=F.getCenterLonLat();
var H=F.getWidth()*this.ratio;
var B=F.getHeight()*this.ratio;
var G=new OpenLayers.Bounds(A.lon-(H/2),A.lat-(B/2),A.lon+(H/2),A.lat+(B/2));
var D=new OpenLayers.LonLat(G.left,G.top);
var C=this.map.getLayerPxFromLonLat(D);
if(!this.grid.length){this.grid[0]=[]
}var E=this.grid[0][0];
if(!E){E=this.addTile(G,C);
this.addTileMonitoringHooks(E);
E.draw();
this.grid[0][0]=E
}else{E.moveTo(G,C)
}this.removeExcessTiles(1,1)
},calculateGridLayout:function(A,O,E){var K=E*this.tileSize.w;
var C=E*this.tileSize.h;
var I=A.left-O.left;
var L=Math.floor(I/K)-this.buffer;
var J=I/K-L;
var F=-J*this.tileSize.w;
var M=O.left+L*K;
var B=A.top-(O.bottom+C);
var H=Math.ceil(B/C)+this.buffer;
var N=H-B/C;
var D=-N*this.tileSize.h;
var G=O.bottom+H*C;
return{tilelon:K,tilelat:C,tileoffsetlon:M,tileoffsetlat:G,tileoffsetx:F,tileoffsety:D}
},initGriddedTiles:function(I){var G=this.map.getSize();
var V=Math.ceil(G.h/this.tileSize.h)+Math.max(1,2*this.buffer);
var X=Math.ceil(G.w/this.tileSize.w)+Math.max(1,2*this.buffer);
var O=this.maxExtent;
var R=this.map.getResolution();
var Q=this.calculateGridLayout(I,O,R);
var F=Math.round(Q.tileoffsetx);
var C=Math.round(Q.tileoffsety);
var K=Q.tileoffsetlon;
var N=Q.tileoffsetlat;
var E=Q.tilelon;
var J=Q.tilelat;
this.origin=new OpenLayers.Pixel(F,C);
var U=F;
var W=K;
var T=0;
var A=parseInt(this.map.layerContainerDiv.style.left);
var S=parseInt(this.map.layerContainerDiv.style.top);
do{var H=this.grid[T++];
if(!H){H=[];
this.grid.push(H)
}K=W;
F=U;
var D=0;
do{var B=new OpenLayers.Bounds(K,N,K+E,N+J);
var M=F;
M-=A;
var L=C;
L-=S;
var P=new OpenLayers.Pixel(M,L);
var Y=H[D++];
if(!Y){Y=this.addTile(B,P);
this.addTileMonitoringHooks(Y);
H.push(Y)
}else{Y.moveTo(B,P,false)
}K+=E;
F+=this.tileSize.w
}while((K<=I.right+E*this.buffer)||D<X);
N-=J;
C+=this.tileSize.h
}while((N>=I.bottom-J*this.buffer)||T<V);
this.removeExcessTiles(T,D);
this.spiralTileLoad()
},spiralTileLoad:function(){var B=[];
this.loadSequence++;
if(this.asyncSpiralQueue){for(var E=0;
E<this.asyncSpiralQueue.length;
E++){this.asyncSpiralQueue[E].queued=false
}this.asyncSpiralQueue=null
}var I=["right","down","left","up"];
var H=0;
var A=-1;
var K=OpenLayers.Util.indexOf(I,"right");
var M=0;
while(M<I.length){var J=H;
var D=A;
switch(I[K]){case"right":D++;
break;
case"down":J++;
break;
case"left":D--;
break;
case"up":J--;
break
}var G=null;
if((J<this.grid.length)&&(J>=0)&&(D<this.grid[0].length)&&(D>=0)){G=this.grid[J][D]
}if((G!=null)&&(!G.queued)){B.unshift(G);
G.queued=true;
M=0;
H=J;
A=D
}else{K=(K+1)%4;
M++
}}for(var E=0,F=B.length;
E<F;
E++){B[E].queued=false
}if(this.delayTileDrawing){this.asyncSpiralQueue=B;
var E=0,F=B.length;
var C=this.loadSequence;
var N=this;
var L=function(){if(N.loadSequence!=C){return 
}try{var O=B[E];
O.draw();
E++
}catch(P){throw P
}if(E!=F){setTimeout(L,0)
}};
setTimeout(L,0)
}else{for(var E=0,F=B.length;
E<F;
E++){B[E].draw()
}}},addTile:function(B,A){},addTileMonitoringHooks:function(A){A.onLoadStart=function(){if(this.numLoadingTiles==0){this.events.triggerEvent("loadstart")
}this.numLoadingTiles++
};
A.events.register("loadstart",this,A.onLoadStart);
A.onLoadEnd=function(){this.numLoadingTiles--;
this.events.triggerEvent("tileloaded");
if(this.numLoadingTiles==0){this.events.triggerEvent("loadend")
}};
A.events.register("loadend",this,A.onLoadEnd);
A.events.register("unload",this,A.onLoadEnd)
},removeTileMonitoringHooks:function(A){A.unload();
A.events.un({loadstart:A.onLoadStart,loadend:A.onLoadEnd,unload:A.onLoadEnd,scope:this})
},moveGriddedTiles:function(C){var B=this.buffer||1;
while(true){var A=this.grid[0][0].position;
var D=this.map.getViewPortPxFromLayerPx(A);
if(D.x>-this.tileSize.w*(B-1)){this.shiftColumn(true)
}else{if(D.x<-this.tileSize.w*B){this.shiftColumn(false)
}else{if(D.y>-this.tileSize.h*(B-1)){this.shiftRow(true)
}else{if(D.y<-this.tileSize.h*B){this.shiftRow(false)
}else{break
}}}}}},shiftRow:function(M){var C=(M)?0:(this.grid.length-1);
var B=this.grid;
var F=B[C];
var E=this.map.getResolution();
var H=(M)?-this.tileSize.h:this.tileSize.h;
var G=E*-H;
var L=(M)?B.pop():B.shift();
for(var I=0,K=F.length;
I<K;
I++){var D=F[I];
var A=D.bounds.clone();
var J=D.position.clone();
A.bottom=A.bottom+G;
A.top=A.top+G;
J.y=J.y+H;
L[I].moveTo(A,J)
}if(M){B.unshift(L)
}else{B.push(L)
}},shiftColumn:function(L){var D=(L)?-this.tileSize.w:this.tileSize.w;
var C=this.map.getResolution();
var J=C*D;
for(var E=0,G=this.grid.length;
E<G;
E++){var K=this.grid[E];
var I=(L)?0:(K.length-1);
var B=K[I];
var A=B.bounds.clone();
var F=B.position.clone();
A.left=A.left+J;
A.right=A.right+J;
F.x=F.x+D;
var H=L?this.grid[E].pop():this.grid[E].shift();
H.moveTo(A,F);
if(L){K.unshift(H)
}else{K.push(H)
}}},removeExcessTiles:function(E,C){while(this.grid.length>E){var F=this.grid.pop();
for(var B=0,A=F.length;
B<A;
B++){var D=F[B];
this.removeTileMonitoringHooks(D);
D.destroy()
}}while(this.grid[0].length>C){for(var B=0,A=this.grid.length;
B<A;
B++){var F=this.grid[B];
var D=F.pop();
this.removeTileMonitoringHooks(D);
D.destroy()
}}},onMapResize:function(){if(this.singleTile){this.clearGrid();
this.setTileSize()
}},getTileBounds:function(D){var C=this.maxExtent;
var F=this.getResolution();
var E=F*this.tileSize.w;
var B=F*this.tileSize.h;
var H=this.getLonLatFromViewPortPx(D);
var A=C.left+(E*Math.floor((H.lon-C.left)/E));
var G=C.bottom+(B*Math.floor((H.lat-C.bottom)/B));
return new OpenLayers.Bounds(A,G,A+E,G+B)
},CLASS_NAME:"OpenLayers.Layer.Grid"});OpenLayers.Layer.Markers=OpenLayers.Class(OpenLayers.Layer,{isBaseLayer:false,markers:null,drawn:false,initialize:function(B,A){OpenLayers.Layer.prototype.initialize.apply(this,arguments);
this.markers=[]
},destroy:function(){this.clearMarkers();
this.markers=null;
OpenLayers.Layer.prototype.destroy.apply(this,arguments)
},setOpacity:function(B){if(B!=this.opacity){this.opacity=B;
for(var C=0,A=this.markers.length;
C<A;
C++){this.markers[C].setOpacity(this.opacity)
}}},moveTo:function(D,B,E){OpenLayers.Layer.prototype.moveTo.apply(this,arguments);
if(B||!this.drawn){for(var C=0,A=this.markers.length;
C<A;
C++){this.drawMarker(this.markers[C])
}this.drawn=true
}},addMarker:function(A){this.markers.push(A);
if(this.opacity!=null){A.setOpacity(this.opacity)
}if(this.map&&this.map.getExtent()){A.map=this.map;
this.drawMarker(A)
}},removeMarker:function(A){if(this.markers&&this.markers.length){OpenLayers.Util.removeItem(this.markers,A);
if((A.icon!=null)&&(A.icon.imageDiv!=null)&&(A.icon.imageDiv.parentNode==this.div)){this.div.removeChild(A.icon.imageDiv);
A.drawn=false
}}},clearMarkers:function(){if(this.markers!=null){while(this.markers.length>0){this.removeMarker(this.markers[0])
}}},drawMarker:function(A){var B=this.map.getLayerPxFromLonLat(A.lonlat);
if(B==null){A.display(false)
}else{var C=A.draw(B);
if(!A.drawn){this.div.appendChild(C);
A.drawn=true
}}},getDataExtent:function(){var B=null;
if(this.markers&&(this.markers.length>0)){var B=new OpenLayers.Bounds();
for(var D=0,A=this.markers.length;
D<A;
D++){var C=this.markers[D];
B.extend(C.lonlat)
}}return B
},CLASS_NAME:"OpenLayers.Layer.Markers"});OpenLayers.Layer.Text=OpenLayers.Class(OpenLayers.Layer.Markers,{location:null,features:null,formatOptions:null,selectedFeature:null,initialize:function(B,A){OpenLayers.Layer.Markers.prototype.initialize.apply(this,arguments);
this.features=new Array()
},destroy:function(){OpenLayers.Layer.Markers.prototype.destroy.apply(this,arguments);
this.clearFeatures();
this.features=null
},loadText:function(){if(!this.loaded){if(this.location!=null){var A=function(B){this.events.triggerEvent("loadend")
};
this.events.triggerEvent("loadstart");
OpenLayers.Request.GET({url:this.location,success:this.parseData,failure:A,scope:this});
this.loaded=true
}}},moveTo:function(C,A,B){OpenLayers.Layer.Markers.prototype.moveTo.apply(this,arguments);
if(this.visibility&&!this.loaded){this.loadText()
}},parseData:function(I){var K=I.responseText;
var M={};
OpenLayers.Util.extend(M,this.formatOptions);
if(this.map&&!this.projection.equals(this.map.getProjectionObject())){M.externalProjection=this.projection;
M.internalProjection=this.map.getProjectionObject()
}var B=new OpenLayers.Format.Text(M);
features=B.read(K);
for(var F=0,G=features.length;
F<G;
F++){var E={};
var L=features[F];
var J;
var H,C;
J=new OpenLayers.LonLat(L.geometry.x,L.geometry.y);
if(L.style.graphicWidth&&L.style.graphicHeight){H=new OpenLayers.Size(L.style.graphicWidth,L.style.graphicHeight)
}if(L.style.graphicXOffset!==undefined&&L.style.graphicYOffset!==undefined){C=new OpenLayers.Pixel(L.style.graphicXOffset,L.style.graphicYOffset)
}if(L.style.externalGraphic!=null){E.icon=new OpenLayers.Icon(L.style.externalGraphic,H,C)
}else{E.icon=OpenLayers.Marker.defaultIcon();
if(H!=null){E.icon.setSize(H)
}}if((L.attributes.title!=null)&&(L.attributes.description!=null)){E.popupContentHTML="<h2>"+L.attributes.title+"</h2><p>"+L.attributes.description+"</p>"
}E.overflow=L.attributes.overflow||"auto";
var A=new OpenLayers.Feature(this,J,E);
this.features.push(A);
var D=A.createMarker();
if((L.attributes.title!=null)&&(L.attributes.description!=null)){D.events.register("click",A,this.markerClick)
}this.addMarker(D)
}this.events.triggerEvent("loadend")
},markerClick:function(B){var D=(this==this.layer.selectedFeature);
this.layer.selectedFeature=(!D)?this:null;
for(var C=0,A=this.layer.map.popups.length;
C<A;
C++){this.layer.map.removePopup(this.layer.map.popups[C])
}if(!D){this.layer.map.addPopup(this.createPopup())
}OpenLayers.Event.stop(B)
},clearFeatures:function(){if(this.features!=null){while(this.features.length>0){var A=this.features[0];
OpenLayers.Util.removeItem(this.features,A);
A.destroy()
}}},CLASS_NAME:"OpenLayers.Layer.Text"});OpenLayers.Layer.WMS=OpenLayers.Class(OpenLayers.Layer.Grid,{DEFAULT_PARAMS:{service:"WMS",version:"1.1.1",request:"GetMap",styles:"",exceptions:"application/vnd.ogc.se_inimage",format:"image/jpeg"},reproject:false,isBaseLayer:true,encodeBBOX:false,initialize:function(D,C,E,B){var A=[];
E=OpenLayers.Util.upperCaseObject(E);
A.push(D,C,E,B);
OpenLayers.Layer.Grid.prototype.initialize.apply(this,A);
OpenLayers.Util.applyDefaults(this.params,OpenLayers.Util.upperCaseObject(this.DEFAULT_PARAMS));
if(this.params.TRANSPARENT&&this.params.TRANSPARENT.toString().toLowerCase()=="true"){if((B==null)||(!B.isBaseLayer)){this.isBaseLayer=false
}if(this.params.FORMAT=="image/jpeg"){this.params.FORMAT=OpenLayers.Util.alphaHack()?"image/gif":"image/png"
}}},destroy:function(){OpenLayers.Layer.Grid.prototype.destroy.apply(this,arguments)
},clone:function(A){if(A==null){A=new OpenLayers.Layer.WMS(this.name,this.url,this.params,this.options)
}A=OpenLayers.Layer.Grid.prototype.clone.apply(this,[A]);
return A
},getURL:function(B){B=this.adjustBounds(B);
var C=this.getImageSize();
var D={BBOX:this.encodeBBOX?B.toBBOX():B.toArray(),WIDTH:C.w,HEIGHT:C.h};
var A=this.getFullRequestString(D);
return A
},addTile:function(B,A){return new OpenLayers.Tile.Image(this,A,B,null,this.tileSize)
},mergeNewParams:function(C){var B=OpenLayers.Util.upperCaseObject(C);
var A=[B];
return OpenLayers.Layer.Grid.prototype.mergeNewParams.apply(this,A)
},getFullRequestString:function(C,B){var A=this.map.getProjection();
this.params.SRS=(A=="none")?null:A;
return OpenLayers.Layer.Grid.prototype.getFullRequestString.apply(this,arguments)
},CLASS_NAME:"OpenLayers.Layer.WMS"});OpenLayers.Layer.WMS.Untiled=OpenLayers.Class(OpenLayers.Layer.WMS,{singleTile:true,initialize:function(C,B,E,A){OpenLayers.Layer.WMS.prototype.initialize.apply(this,arguments);
var D="The OpenLayers.Layer.WMS.Untiled class is deprecated and will be removed in 3.0. Instead, you should use the normal OpenLayers.Layer.WMS class, passing it the option 'singleTile' as true.";
OpenLayers.Console.warn(D)
},clone:function(A){if(A==null){A=new OpenLayers.Layer.WMS.Untiled(this.name,this.url,this.params,this.options)
}A=OpenLayers.Layer.WMS.prototype.clone.apply(this,[A]);
return A
},CLASS_NAME:"OpenLayers.Layer.WMS.Untiled"});OpenLayers.Layer.Boxes=OpenLayers.Class(OpenLayers.Layer.Markers,{initialize:function(B,A){OpenLayers.Layer.Markers.prototype.initialize.apply(this,arguments)
},drawMarker:function(A){var D=A.bounds;
var F=this.map.getLayerPxFromLonLat(new OpenLayers.LonLat(D.left,D.top));
var C=this.map.getLayerPxFromLonLat(new OpenLayers.LonLat(D.right,D.bottom));
if(C==null||F==null){A.display(false)
}else{var E=new OpenLayers.Size(Math.max(1,C.x-F.x),Math.max(1,C.y-F.y));
var B=A.draw(F,E);
if(!A.drawn){this.div.appendChild(B);
A.drawn=true
}}},removeMarker:function(A){OpenLayers.Util.removeItem(this.markers,A);
if((A.div!=null)&&(A.div.parentNode==this.div)){this.div.removeChild(A.div)
}},CLASS_NAME:"OpenLayers.Layer.Boxes"});OpenLayers.Layer.TileCache=OpenLayers.Class(OpenLayers.Layer.Grid,{isBaseLayer:true,tileOrigin:null,format:"image/png",initialize:function(C,B,D,A){this.layername=D;
OpenLayers.Layer.Grid.prototype.initialize.apply(this,[C,B,{},A]);
this.extension=this.format.split("/")[1].toLowerCase();
this.extension=(this.extension=="jpg")?"jpeg":this.extension
},clone:function(A){if(A==null){A=new OpenLayers.Layer.TileCache(this.name,this.url,this.layername,this.options)
}A=OpenLayers.Layer.Grid.prototype.clone.apply(this,[A]);
return A
},getURL:function(B){var F=this.map.getResolution();
var G=this.maxExtent;
var K=this.tileSize;
var A=Math.round((B.left-G.left)/(F*K.w));
var J=Math.round((B.bottom-G.bottom)/(F*K.h));
var H=this.map.zoom;
function E(O,N){O=String(O);
var L=[];
for(var M=0;
M<N;
++M){L.push("0")
}return L.join("").substring(0,N-O.length)+O
}var D=[this.layername,E(H,2),E(parseInt(A/1000000),3),E((parseInt(A/1000)%1000),3),E((parseInt(A)%1000),3),E(parseInt(J/1000000),3),E((parseInt(J/1000)%1000),3),E((parseInt(J)%1000),3)+"."+this.extension];
var I=D.join("/");
var C=this.url;
if(C instanceof Array){C=this.selectUrl(I,C)
}C=(C.charAt(C.length-1)=="/")?C:C+"/";
return C+I
},addTile:function(C,A){var B=this.getURL(C);
return new OpenLayers.Tile.Image(this,A,C,B,this.tileSize)
},setMap:function(A){OpenLayers.Layer.Grid.prototype.setMap.apply(this,arguments);
if(!this.tileOrigin){this.tileOrigin=new OpenLayers.LonLat(this.map.maxExtent.left,this.map.maxExtent.bottom)
}},CLASS_NAME:"OpenLayers.Layer.TileCache"});OpenLayers.Popup.Anchored=OpenLayers.Class(OpenLayers.Popup,{relativePosition:null,anchor:null,initialize:function(H,D,G,C,B,F,E){var A=[H,D,G,C,F,E];
OpenLayers.Popup.prototype.initialize.apply(this,A);
this.anchor=(B!=null)?B:{size:new OpenLayers.Size(0,0),offset:new OpenLayers.Pixel(0,0)}
},destroy:function(){this.anchor=null;
this.relativePosition=null;
OpenLayers.Popup.prototype.destroy.apply(this,arguments)
},show:function(){this.updatePosition();
OpenLayers.Popup.prototype.show.apply(this,arguments)
},moveTo:function(C){var B=this.relativePosition;
this.relativePosition=this.calculateRelativePosition(C);
var D=this.calculateNewPx(C);
var A=new Array(D);
OpenLayers.Popup.prototype.moveTo.apply(this,A);
if(this.relativePosition!=B){this.updateRelativePosition()
}},setSize:function(B){OpenLayers.Popup.prototype.setSize.apply(this,arguments);
if((this.lonlat)&&(this.map)){var A=this.map.getLayerPxFromLonLat(this.lonlat);
this.moveTo(A)
}},calculateRelativePosition:function(B){var D=this.map.getLonLatFromLayerPx(B);
var C=this.map.getExtent();
var A=C.determineQuadrant(D);
return OpenLayers.Bounds.oppositeQuadrant(A)
},updateRelativePosition:function(){},calculateNewPx:function(B){var E=B.offset(this.anchor.offset);
var A=this.size||this.contentSize;
var D=(this.relativePosition.charAt(0)=="t");
E.y+=(D)?-A.h:this.anchor.size.h;
var C=(this.relativePosition.charAt(1)=="l");
E.x+=(C)?-A.w:this.anchor.size.w;
return E
},CLASS_NAME:"OpenLayers.Popup.Anchored"});OpenLayers.Popup.AnchoredBubble=OpenLayers.Class(OpenLayers.Popup.Anchored,{rounded:false,initialize:function(G,C,F,B,A,E,D){this.padding=new OpenLayers.Bounds(0,OpenLayers.Popup.AnchoredBubble.CORNER_SIZE,0,OpenLayers.Popup.AnchoredBubble.CORNER_SIZE);
OpenLayers.Popup.Anchored.prototype.initialize.apply(this,arguments)
},draw:function(A){OpenLayers.Popup.Anchored.prototype.draw.apply(this,arguments);
this.setContentHTML();
this.setBackgroundColor();
this.setOpacity();
return this.div
},updateRelativePosition:function(){this.setRicoCorners()
},setSize:function(A){OpenLayers.Popup.Anchored.prototype.setSize.apply(this,arguments);
this.setRicoCorners()
},setBackgroundColor:function(A){if(A!=undefined){this.backgroundColor=A
}if(this.div!=null){if(this.contentDiv!=null){this.div.style.background="transparent";
OpenLayers.Rico.Corner.changeColor(this.groupDiv,this.backgroundColor)
}}},setOpacity:function(A){OpenLayers.Popup.Anchored.prototype.setOpacity.call(this,A);
if(this.div!=null){if(this.groupDiv!=null){OpenLayers.Rico.Corner.changeOpacity(this.groupDiv,this.opacity)
}}},setBorder:function(A){this.border=0
},setRicoCorners:function(){var A=this.getCornersToRound(this.relativePosition);
var B={corners:A,color:this.backgroundColor,bgColor:"transparent",blend:false};
if(!this.rounded){OpenLayers.Rico.Corner.round(this.div,B);
this.rounded=true
}else{OpenLayers.Rico.Corner.reRound(this.groupDiv,B);
this.setBackgroundColor();
this.setOpacity()
}},getCornersToRound:function(){var A=["tl","tr","bl","br"];
var B=OpenLayers.Bounds.oppositeQuadrant(this.relativePosition);
OpenLayers.Util.removeItem(A,B);
return A.join(" ")
},CLASS_NAME:"OpenLayers.Popup.AnchoredBubble"});
OpenLayers.Popup.AnchoredBubble.CORNER_SIZE=5;OpenLayers.Popup.Framed=OpenLayers.Class(OpenLayers.Popup.Anchored,{imageSrc:null,imageSize:null,isAlphaImage:false,positionBlocks:null,blocks:null,fixedRelativePosition:false,adjustClosePos:{right:0,top:0},initialize:function(G,C,F,B,A,E,D){OpenLayers.Popup.Anchored.prototype.initialize.apply(this,arguments);
if(this.fixedRelativePosition){this.updateRelativePosition();
this.calculateRelativePosition=function(H){return this.relativePosition
}
}this.contentDiv.style.position="absolute";
this.contentDiv.style.zIndex=1;
if(E){this.closeDiv.style.zIndex=1
}this.groupDiv.style.position="absolute";
this.groupDiv.style.top="0px";
this.groupDiv.style.left="0px";
this.groupDiv.style.height="100%";
this.groupDiv.style.width="100%"
},destroy:function(){this.imageSrc=null;
this.imageSize=null;
this.isAlphaImage=null;
this.fixedRelativePosition=false;
this.positionBlocks=null;
for(var A=0;
A<this.blocks.length;
A++){var B=this.blocks[A];
if(B.image){B.div.removeChild(B.image)
}B.image=null;
if(B.div){this.groupDiv.removeChild(B.div)
}B.div=null
}this.blocks=null;
OpenLayers.Popup.Anchored.prototype.destroy.apply(this,arguments)
},setBackgroundColor:function(A){},setBorder:function(){},setOpacity:function(A){},setSize:function(A){OpenLayers.Popup.Anchored.prototype.setSize.apply(this,arguments);
this.updateBlocks()
},updateRelativePosition:function(){this.padding=this.positionBlocks[this.relativePosition].padding;
if(this.closeDiv){var A=this.getContentDivPadding();
this.closeDiv.style.right=(A.right+this.padding.right+this.adjustClosePos.right)+"px";
this.closeDiv.style.top=(A.top+this.padding.top+this.adjustClosePos.top)+"px"
}this.updateBlocks()
},calculateNewPx:function(A){var B=OpenLayers.Popup.Anchored.prototype.calculateNewPx.apply(this,arguments);
B=B.offset(this.positionBlocks[this.relativePosition].offset);
return B
},createBlocks:function(){this.blocks=[];
var F=null;
for(var E in this.positionBlocks){F=E;
break
}var A=this.positionBlocks[F];
for(var D=0;
D<A.blocks.length;
D++){var H={};
this.blocks.push(H);
var B=this.id+"_FrameDecorationDiv_"+D;
H.div=OpenLayers.Util.createDiv(B,null,null,null,"absolute",null,"hidden",null);
var C=this.id+"_FrameDecorationImg_"+D;
var G=(this.isAlphaImage)?OpenLayers.Util.createAlphaImageDiv:OpenLayers.Util.createImage;
H.image=G(C,null,this.imageSize,this.imageSrc,"absolute",null,null,null);
H.div.appendChild(H.image);
this.groupDiv.appendChild(H.div)
}},updateBlocks:function(){if(!this.blocks){this.createBlocks()
}if(this.size&&this.relativePosition){var G=this.positionBlocks[this.relativePosition];
for(var E=0;
E<G.blocks.length;
E++){var B=G.blocks[E];
var D=this.blocks[E];
var C=B.anchor.left;
var H=B.anchor.bottom;
var A=B.anchor.right;
var J=B.anchor.top;
var I=(isNaN(B.size.w))?this.size.w-(A+C):B.size.w;
var F=(isNaN(B.size.h))?this.size.h-(H+J):B.size.h;
D.div.style.width=I+"px";
D.div.style.height=F+"px";
D.div.style.left=(C!=null)?C+"px":"";
D.div.style.bottom=(H!=null)?H+"px":"";
D.div.style.right=(A!=null)?A+"px":"";
D.div.style.top=(J!=null)?J+"px":"";
D.image.style.left=B.position.x+"px";
D.image.style.top=B.position.y+"px"
}this.contentDiv.style.left=this.padding.left+"px";
this.contentDiv.style.top=this.padding.top+"px"
}},CLASS_NAME:"OpenLayers.Popup.Framed"});OpenLayers.Popup.FramedCloud=OpenLayers.Class(OpenLayers.Popup.Framed,{contentDisplayClass:"olFramedCloudPopupContent",autoSize:true,panMapIfOutOfView:true,imageSize:new OpenLayers.Size(676,736),isAlphaImage:false,fixedRelativePosition:false,positionBlocks:{tl:{offset:new OpenLayers.Pixel(44,0),padding:new OpenLayers.Bounds(8,40,8,9),blocks:[{size:new OpenLayers.Size("auto","auto"),anchor:new OpenLayers.Bounds(0,51,22,0),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(22,"auto"),anchor:new OpenLayers.Bounds(null,50,0,0),position:new OpenLayers.Pixel(-638,0)},{size:new OpenLayers.Size("auto",21),anchor:new OpenLayers.Bounds(0,32,80,null),position:new OpenLayers.Pixel(0,-629)},{size:new OpenLayers.Size(22,21),anchor:new OpenLayers.Bounds(null,32,0,null),position:new OpenLayers.Pixel(-638,-629)},{size:new OpenLayers.Size(81,54),anchor:new OpenLayers.Bounds(null,0,0,null),position:new OpenLayers.Pixel(0,-668)}]},tr:{offset:new OpenLayers.Pixel(-45,0),padding:new OpenLayers.Bounds(8,40,8,9),blocks:[{size:new OpenLayers.Size("auto","auto"),anchor:new OpenLayers.Bounds(0,51,22,0),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(22,"auto"),anchor:new OpenLayers.Bounds(null,50,0,0),position:new OpenLayers.Pixel(-638,0)},{size:new OpenLayers.Size("auto",21),anchor:new OpenLayers.Bounds(0,32,22,null),position:new OpenLayers.Pixel(0,-629)},{size:new OpenLayers.Size(22,21),anchor:new OpenLayers.Bounds(null,32,0,null),position:new OpenLayers.Pixel(-638,-629)},{size:new OpenLayers.Size(81,54),anchor:new OpenLayers.Bounds(0,0,null,null),position:new OpenLayers.Pixel(-215,-668)}]},bl:{offset:new OpenLayers.Pixel(45,0),padding:new OpenLayers.Bounds(8,9,8,40),blocks:[{size:new OpenLayers.Size("auto","auto"),anchor:new OpenLayers.Bounds(0,21,22,32),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(22,"auto"),anchor:new OpenLayers.Bounds(null,21,0,32),position:new OpenLayers.Pixel(-638,0)},{size:new OpenLayers.Size("auto",21),anchor:new OpenLayers.Bounds(0,0,22,null),position:new OpenLayers.Pixel(0,-629)},{size:new OpenLayers.Size(22,21),anchor:new OpenLayers.Bounds(null,0,0,null),position:new OpenLayers.Pixel(-638,-629)},{size:new OpenLayers.Size(81,54),anchor:new OpenLayers.Bounds(null,null,0,0),position:new OpenLayers.Pixel(-101,-674)}]},br:{offset:new OpenLayers.Pixel(-44,0),padding:new OpenLayers.Bounds(8,9,8,40),blocks:[{size:new OpenLayers.Size("auto","auto"),anchor:new OpenLayers.Bounds(0,21,22,32),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(22,"auto"),anchor:new OpenLayers.Bounds(null,21,0,32),position:new OpenLayers.Pixel(-638,0)},{size:new OpenLayers.Size("auto",21),anchor:new OpenLayers.Bounds(0,0,22,null),position:new OpenLayers.Pixel(0,-629)},{size:new OpenLayers.Size(22,21),anchor:new OpenLayers.Bounds(null,0,0,null),position:new OpenLayers.Pixel(-638,-629)},{size:new OpenLayers.Size(81,54),anchor:new OpenLayers.Bounds(0,null,null,0),position:new OpenLayers.Pixel(-311,-674)}]}},minSize:new OpenLayers.Size(105,10),maxSize:new OpenLayers.Size(600,660),initialize:function(G,C,F,B,A,E,D){this.imageSrc=OpenLayers.Util.getImagesLocation()+"cloud-popup-relative.png";
OpenLayers.Popup.Framed.prototype.initialize.apply(this,arguments);
this.contentDiv.className=this.contentDisplayClass
},destroy:function(){OpenLayers.Popup.Framed.prototype.destroy.apply(this,arguments)
},CLASS_NAME:"OpenLayers.Popup.FramedCloud"});OpenLayers.Feature=OpenLayers.Class({layer:null,id:null,lonlat:null,data:null,marker:null,popupClass:OpenLayers.Popup.AnchoredBubble,popup:null,initialize:function(A,C,B){this.layer=A;
this.lonlat=C;
this.data=(B!=null)?B:{};
this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")
},destroy:function(){if((this.layer!=null)&&(this.layer.map!=null)){if(this.popup!=null){this.layer.map.removePopup(this.popup)
}}this.layer=null;
this.id=null;
this.lonlat=null;
this.data=null;
if(this.marker!=null){this.destroyMarker(this.marker);
this.marker=null
}if(this.popup!=null){this.destroyPopup(this.popup);
this.popup=null
}},onScreen:function(){var B=false;
if((this.layer!=null)&&(this.layer.map!=null)){var A=this.layer.map.getExtent();
B=A.containsLonLat(this.lonlat)
}return B
},createMarker:function(){if(this.lonlat!=null){this.marker=new OpenLayers.Marker(this.lonlat,this.data.icon)
}return this.marker
},destroyMarker:function(){this.marker.destroy()
},createPopup:function(B){if(this.lonlat!=null){var C=this.id+"_popup";
var A=(this.marker)?this.marker.icon:null;
if(!this.popup){this.popup=new this.popupClass(C,this.lonlat,this.data.popupSize,this.data.popupContentHTML,A,B)
}if(this.data.overflow!=null){this.popup.contentDiv.style.overflow=this.data.overflow
}this.popup.feature=this
}return this.popup
},destroyPopup:function(){if(this.popup){this.popup.feature=null;
this.popup.destroy();
this.popup=null
}},CLASS_NAME:"OpenLayers.Feature"});OpenLayers.State={UNKNOWN:"Unknown",INSERT:"Insert",UPDATE:"Update",DELETE:"Delete"};
OpenLayers.Feature.Vector=OpenLayers.Class(OpenLayers.Feature,{fid:null,geometry:null,attributes:null,state:null,style:null,renderIntent:"default",initialize:function(C,A,B){OpenLayers.Feature.prototype.initialize.apply(this,[null,null,A]);
this.lonlat=null;
this.geometry=C?C:null;
this.state=null;
this.attributes={};
if(A){this.attributes=OpenLayers.Util.extend(this.attributes,A)
}this.style=B?B:null
},destroy:function(){if(this.layer){this.layer.removeFeatures(this);
this.layer=null
}this.geometry=null;
OpenLayers.Feature.prototype.destroy.apply(this,arguments)
},clone:function(){return new OpenLayers.Feature.Vector(this.geometry?this.geometry.clone():null,this.attributes,this.style)
},onScreen:function(D){var C=false;
if(this.layer&&this.layer.map){var A=this.layer.map.getExtent();
if(D){var B=this.geometry.getBounds();
C=A.intersectsBounds(B)
}else{var E=A.toGeometry();
C=E.intersects(this.geometry)
}}return C
},createMarker:function(){return null
},destroyMarker:function(){},createPopup:function(){return null
},atPoint:function(B,D,C){var A=false;
if(this.geometry){A=this.geometry.atPoint(B,D,C)
}return A
},destroyPopup:function(){},move:function(A){if(!this.layer||!this.geometry.move){return 
}var B;
if(A.CLASS_NAME=="OpenLayers.LonLat"){B=this.layer.getViewPortPxFromLonLat(A)
}else{B=A
}var D=this.layer.getViewPortPxFromLonLat(this.geometry.getBounds().getCenterLonLat());
var C=this.layer.map.getResolution();
this.geometry.move(C*(B.x-D.x),C*(D.y-B.y));
this.layer.drawFeature(this);
return D
},toState:function(A){if(A==OpenLayers.State.UPDATE){switch(this.state){case OpenLayers.State.UNKNOWN:case OpenLayers.State.DELETE:this.state=A;
break;
case OpenLayers.State.UPDATE:case OpenLayers.State.INSERT:break
}}else{if(A==OpenLayers.State.INSERT){switch(this.state){case OpenLayers.State.UNKNOWN:break;
default:this.state=A;
break
}}else{if(A==OpenLayers.State.DELETE){switch(this.state){case OpenLayers.State.INSERT:break;
case OpenLayers.State.DELETE:break;
case OpenLayers.State.UNKNOWN:case OpenLayers.State.UPDATE:this.state=A;
break
}}else{if(A==OpenLayers.State.UNKNOWN){this.state=A
}}}}},CLASS_NAME:"OpenLayers.Feature.Vector"});
OpenLayers.Feature.Vector.style={"default":{fillColor:"#ee9900",fillOpacity:0.4,hoverFillColor:"white",hoverFillOpacity:0.8,strokeColor:"#ee9900",strokeOpacity:1,strokeWidth:1,strokeLinecap:"round",strokeDashstyle:"solid",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:0.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:"inherit"},select:{fillColor:"blue",fillOpacity:0.4,hoverFillColor:"white",hoverFillOpacity:0.8,strokeColor:"blue",strokeOpacity:1,strokeWidth:2,strokeLinecap:"round",strokeDashstyle:"solid",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:0.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:"pointer"},temporary:{fillColor:"yellow",fillOpacity:0.2,hoverFillColor:"white",hoverFillOpacity:0.8,strokeColor:"yellow",strokeOpacity:1,strokeLinecap:"round",strokeWidth:4,strokeDashstyle:"solid",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:0.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:"inherit"}};OpenLayers.Feature.WFS=OpenLayers.Class(OpenLayers.Feature,{initialize:function(C,B){var A=arguments;
var D=this.processXMLNode(B);
A=new Array(C,D.lonlat,D);
OpenLayers.Feature.prototype.initialize.apply(this,A);
this.createMarker();
this.layer.addMarker(this.marker)
},destroy:function(){if(this.marker!=null){this.layer.removeMarker(this.marker)
}OpenLayers.Feature.prototype.destroy.apply(this,arguments)
},processXMLNode:function(B){var A=OpenLayers.Ajax.getElementsByTagNameNS(B,"http://www.opengis.net/gml","gml","Point");
var D=OpenLayers.Util.getXmlNodeValue(OpenLayers.Ajax.getElementsByTagNameNS(A[0],"http://www.opengis.net/gml","gml","coordinates")[0]);
var C=D.split(",");
return{lonlat:new OpenLayers.LonLat(parseFloat(C[0]),parseFloat(C[1])),id:null}
},CLASS_NAME:"OpenLayers.Feature.WFS"});OpenLayers.Handler=OpenLayers.Class({id:null,control:null,map:null,keyMask:null,active:false,evt:null,initialize:function(C,B,A){OpenLayers.Util.extend(this,A);
this.control=C;
this.callbacks=B;
if(C.map){this.setMap(C.map)
}OpenLayers.Util.extend(this,A);
this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")
},setMap:function(A){this.map=A
},checkModifiers:function(A){if(this.keyMask==null){return true
}var B=(A.shiftKey?OpenLayers.Handler.MOD_SHIFT:0)|(A.ctrlKey?OpenLayers.Handler.MOD_CTRL:0)|(A.altKey?OpenLayers.Handler.MOD_ALT:0);
return(B==this.keyMask)
},activate:function(){if(this.active){return false
}var C=OpenLayers.Events.prototype.BROWSER_EVENTS;
for(var B=0,A=C.length;
B<A;
B++){if(this[C[B]]){this.register(C[B],this[C[B]])
}}this.active=true;
return true
},deactivate:function(){if(!this.active){return false
}var C=OpenLayers.Events.prototype.BROWSER_EVENTS;
for(var B=0,A=C.length;
B<A;
B++){if(this[C[B]]){this.unregister(C[B],this[C[B]])
}}this.active=false;
return true
},callback:function(B,A){if(B&&this.callbacks[B]){this.callbacks[B].apply(this.control,A)
}},register:function(A,B){this.map.events.registerPriority(A,this,B);
this.map.events.registerPriority(A,this,this.setEvent)
},unregister:function(A,B){this.map.events.unregister(A,this,B);
this.map.events.unregister(A,this,this.setEvent)
},setEvent:function(A){this.evt=A;
return true
},destroy:function(){this.deactivate();
this.control=this.map=null
},CLASS_NAME:"OpenLayers.Handler"});
OpenLayers.Handler.MOD_NONE=0;
OpenLayers.Handler.MOD_SHIFT=1;
OpenLayers.Handler.MOD_CTRL=2;
OpenLayers.Handler.MOD_ALT=4;OpenLayers.Handler.Click=OpenLayers.Class(OpenLayers.Handler,{delay:300,single:true,"double":false,pixelTolerance:0,stopSingle:false,stopDouble:false,timerId:null,down:null,rightclickTimerId:null,initialize:function(C,B,A){OpenLayers.Handler.prototype.initialize.apply(this,arguments);
if(this.pixelTolerance!=null){this.mousedown=function(D){this.down=D.xy;
return true
}
}},mousedown:null,mouseup:function(B){var A=true;
if(this.checkModifiers(B)&&this.control.handleRightClicks&&OpenLayers.Event.isRightClick(B)){propogate=this.rightclick(B)
}return A
},rightclick:function(B){if(this.passesTolerance(B)){if(this.rightclickTimerId!=null){this.clearTimer();
this.callback("dblrightclick",[B]);
return !this.stopDouble
}else{var A=this["double"]?OpenLayers.Util.extend({},B):this.callback("rightclick",[B]);
var C=OpenLayers.Function.bind(this.delayedRightCall,this,A);
this.rightclickTimerId=window.setTimeout(C,this.delay)
}}return !this.stopSingle
},delayedRightCall:function(A){this.rightclickTimerId=null;
if(A){this.callback("rightclick",[A])
}return !this.stopSingle
},dblclick:function(A){if(this.passesTolerance(A)){if(this["double"]){this.callback("dblclick",[A])
}this.clearTimer()
}return !this.stopDouble
},click:function(B){if(this.passesTolerance(B)){if(this.timerId!=null){this.clearTimer()
}else{var A=this.single?OpenLayers.Util.extend({},B):null;
this.timerId=window.setTimeout(OpenLayers.Function.bind(this.delayedCall,this,A),this.delay)
}}return !this.stopSingle
},passesTolerance:function(B){var C=true;
if(this.pixelTolerance!=null&&this.down){var A=Math.sqrt(Math.pow(this.down.x-B.xy.x,2)+Math.pow(this.down.y-B.xy.y,2));
if(A>this.pixelTolerance){C=false
}}return C
},clearTimer:function(){if(this.timerId!=null){window.clearTimeout(this.timerId);
this.timerId=null
}},delayedCall:function(A){this.timerId=null;
if(A){this.callback("click",[A])
}},deactivate:function(){var A=false;
if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){this.clearTimer();
this.down=null;
A=true
}return A
},CLASS_NAME:"OpenLayers.Handler.Click"});OpenLayers.Handler.Hover=OpenLayers.Class(OpenLayers.Handler,{delay:500,pixelTolerance:null,stopMove:false,px:null,timerId:null,initialize:function(C,B,A){OpenLayers.Handler.prototype.initialize.apply(this,arguments)
},mousemove:function(A){if(this.passesTolerance(A.xy)){this.clearTimer();
this.callback("move",[A]);
this.px=A.xy;
A=OpenLayers.Util.extend({},A);
this.timerId=window.setTimeout(OpenLayers.Function.bind(this.delayedCall,this,A),this.delay)
}return !this.stopMove
},mouseout:function(A){if(OpenLayers.Util.mouseLeft(A,this.map.div)){this.clearTimer();
this.callback("move",[A])
}return true
},passesTolerance:function(B){var C=true;
if(this.pixelTolerance&&this.px){var A=Math.sqrt(Math.pow(this.px.x-B.x,2)+Math.pow(this.px.y-B.y,2));
if(A<this.pixelTolerance){C=false
}}return C
},clearTimer:function(){if(this.timerId!=null){window.clearTimeout(this.timerId);
this.timerId=null
}},delayedCall:function(A){this.callback("pause",[A])
},deactivate:function(){var A=false;
if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){this.clearTimer();
A=true
}return A
},CLASS_NAME:"OpenLayers.Handler.Hover"});OpenLayers.Handler.Point=OpenLayers.Class(OpenLayers.Handler,{point:null,layer:null,multi:false,drawing:false,mouseDown:false,lastDown:null,lastUp:null,persist:false,layerOptions:null,initialize:function(C,B,A){this.style=OpenLayers.Util.extend(OpenLayers.Feature.Vector.style["default"],{});
OpenLayers.Handler.prototype.initialize.apply(this,arguments)
},activate:function(){if(!OpenLayers.Handler.prototype.activate.apply(this,arguments)){return false
}var A=OpenLayers.Util.extend({displayInLayerSwitcher:false,calculateInRange:function(){return true
}},this.layerOptions);
this.layer=new OpenLayers.Layer.Vector(this.CLASS_NAME,A);
this.map.addLayer(this.layer);
return true
},createFeature:function(){this.point=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point());
this.layer.addFeatures([this.point],{silent:true})
},deactivate:function(){if(!OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){return false
}if(this.drawing){this.cancel()
}this.destroyFeature();
if(this.layer.map!=null){this.layer.destroy(false)
}this.layer=null;
return true
},destroyFeature:function(){if(this.layer){this.layer.destroyFeatures()
}this.point=null
},finalize:function(B){var A=B?"cancel":"done";
this.drawing=false;
this.mouseDown=false;
this.lastDown=null;
this.lastUp=null;
this.callback(A,[this.geometryClone()]);
if(B||!this.persist){this.destroyFeature()
}},cancel:function(){this.finalize(true)
},click:function(A){OpenLayers.Event.stop(A);
return false
},dblclick:function(A){OpenLayers.Event.stop(A);
return false
},drawFeature:function(){this.layer.drawFeature(this.point,this.style)
},getGeometry:function(){var A=this.point.geometry;
if(this.multi){A=new OpenLayers.Geometry.MultiPoint([A])
}return A
},geometryClone:function(){return this.getGeometry().clone()
},mousedown:function(A){if(!this.checkModifiers(A)){return true
}if(this.lastDown&&this.lastDown.equals(A.xy)){return true
}if(this.lastDown==null){if(this.persist){this.destroyFeature()
}this.createFeature()
}this.lastDown=A.xy;
this.drawing=true;
var B=this.map.getLonLatFromPixel(A.xy);
this.point.geometry.x=B.lon;
this.point.geometry.y=B.lat;
this.point.geometry.clearBounds();
this.drawFeature();
return false
},mousemove:function(A){if(this.drawing){var B=this.map.getLonLatFromPixel(A.xy);
this.point.geometry.x=B.lon;
this.point.geometry.y=B.lat;
this.point.geometry.clearBounds();
this.drawFeature()
}return true
},mouseup:function(A){if(this.drawing){this.finalize();
return false
}else{return true
}},CLASS_NAME:"OpenLayers.Handler.Point"});OpenLayers.Handler.Path=OpenLayers.Class(OpenLayers.Handler.Point,{line:null,freehand:false,freehandToggle:"shiftKey",initialize:function(C,B,A){OpenLayers.Handler.Point.prototype.initialize.apply(this,arguments)
},createFeature:function(){this.line=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LineString());
this.point=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point());
this.layer.addFeatures([this.line,this.point],{silent:true})
},destroyFeature:function(){OpenLayers.Handler.Point.prototype.destroyFeature.apply(this);
this.line=null
},destroyPoint:function(){if(this.point){this.layer.destroyFeatures([this.point])
}},addPoint:function(){this.line.geometry.addComponent(this.point.geometry.clone(),this.line.geometry.components.length);
this.callback("point",[this.point.geometry,this.getGeometry()])
},freehandMode:function(A){return(this.freehandToggle&&A[this.freehandToggle])?!this.freehand:this.freehand
},modifyFeature:function(){var A=this.line.geometry.components.length-1;
this.line.geometry.components[A].x=this.point.geometry.x;
this.line.geometry.components[A].y=this.point.geometry.y;
this.line.geometry.components[A].clearBounds()
},drawFeature:function(){this.layer.drawFeature(this.line,this.style);
this.layer.drawFeature(this.point,this.style)
},getGeometry:function(){var A=this.line.geometry;
if(this.multi){A=new OpenLayers.Geometry.MultiLineString([A])
}return A
},mousedown:function(A){if(this.lastDown&&this.lastDown.equals(A.xy)){return false
}if(this.lastDown==null){if(this.persist){this.destroyFeature()
}this.createFeature()
}this.mouseDown=true;
this.lastDown=A.xy;
var B=this.control.map.getLonLatFromPixel(A.xy);
this.point.geometry.x=B.lon;
this.point.geometry.y=B.lat;
this.point.geometry.clearBounds();
if((this.lastUp==null)||!this.lastUp.equals(A.xy)){this.addPoint()
}this.drawFeature();
this.drawing=true;
return false
},mousemove:function(A){if(this.drawing){var B=this.map.getLonLatFromPixel(A.xy);
this.point.geometry.x=B.lon;
this.point.geometry.y=B.lat;
this.point.geometry.clearBounds();
if(this.mouseDown&&this.freehandMode(A)){this.addPoint()
}else{this.modifyFeature()
}this.drawFeature()
}return true
},mouseup:function(A){this.mouseDown=false;
if(this.drawing){if(this.freehandMode(A)){if(this.persist){this.destroyPoint()
}this.finalize()
}else{if(this.lastUp==null){this.addPoint()
}this.lastUp=A.xy
}return false
}return true
},dblclick:function(A){if(!this.freehandMode(A)){var B=this.line.geometry.components.length-1;
this.line.geometry.removeComponent(this.line.geometry.components[B]);
if(this.persist){this.destroyPoint()
}this.finalize()
}return false
},CLASS_NAME:"OpenLayers.Handler.Path"});OpenLayers.Handler.Polygon=OpenLayers.Class(OpenLayers.Handler.Path,{polygon:null,initialize:function(C,B,A){OpenLayers.Handler.Path.prototype.initialize.apply(this,arguments)
},createFeature:function(){this.polygon=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon());
this.line=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LinearRing());
this.polygon.geometry.addComponent(this.line.geometry);
this.point=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point());
this.layer.addFeatures([this.polygon,this.point],{silent:true})
},destroyFeature:function(){OpenLayers.Handler.Path.prototype.destroyFeature.apply(this);
this.polygon=null
},modifyFeature:function(){var A=this.line.geometry.components.length-2;
this.line.geometry.components[A].x=this.point.geometry.x;
this.line.geometry.components[A].y=this.point.geometry.y;
this.line.geometry.components[A].clearBounds()
},drawFeature:function(){this.layer.drawFeature(this.polygon,this.style);
this.layer.drawFeature(this.point,this.style)
},getGeometry:function(){var A=this.polygon.geometry;
if(this.multi){A=new OpenLayers.Geometry.MultiPolygon([A])
}return A
},dblclick:function(A){if(!this.freehandMode(A)){var B=this.line.geometry.components.length-2;
this.line.geometry.removeComponent(this.line.geometry.components[B]);
if(this.persist){this.destroyPoint()
}this.finalize()
}return false
},CLASS_NAME:"OpenLayers.Handler.Polygon"});OpenLayers.Handler.Feature=OpenLayers.Class(OpenLayers.Handler,{EVENTMAP:{click:{"in":"click",out:"clickout"},mousemove:{"in":"over",out:"out"},dblclick:{"in":"dblclick",out:null},mousedown:{"in":null,out:null},mouseup:{"in":null,out:null}},feature:null,lastFeature:null,down:null,up:null,clickoutTolerance:4,geometryTypes:null,stopClick:true,stopDown:true,stopUp:false,initialize:function(D,B,C,A){OpenLayers.Handler.prototype.initialize.apply(this,[D,C,A]);
this.layer=B
},mousedown:function(A){this.down=A.xy;
return this.handle(A)?!this.stopDown:true
},mouseup:function(A){this.up=A.xy;
return this.handle(A)?!this.stopUp:true
},click:function(A){return this.handle(A)?!this.stopClick:true
},mousemove:function(A){if(!this.callbacks.over&&!this.callbacks.out){return true
}this.handle(A);
return true
},dblclick:function(A){return !this.handle(A)
},geometryTypeMatches:function(A){return this.geometryTypes==null||OpenLayers.Util.indexOf(this.geometryTypes,A.geometry.CLASS_NAME)>-1
},handle:function(A){var C=A.type;
var F=false;
var E=!!(this.feature);
var D=(C=="click"||C=="dblclick");
this.feature=this.layer.getFeatureFromEvent(A);
if(this.feature){var B=(this.feature!=this.lastFeature);
if(this.geometryTypeMatches(this.feature)){if(E&&B){this.triggerCallback(C,"out",[this.lastFeature]);
this.triggerCallback(C,"in",[this.feature])
}else{if(!E||D){this.triggerCallback(C,"in",[this.feature])
}}this.lastFeature=this.feature;
F=true
}else{if(E&&B||(D&&this.lastFeature)){this.triggerCallback(C,"out",[this.lastFeature])
}this.feature=null
}}else{if(E||(D&&this.lastFeature)){this.triggerCallback(C,"out",[this.lastFeature])
}}return F
},triggerCallback:function(D,E,B){var C=this.EVENTMAP[D][E];
if(C){if(D=="click"&&E=="out"&&this.up&&this.down){var A=Math.sqrt(Math.pow(this.up.x-this.down.x,2)+Math.pow(this.up.y-this.down.y,2));
if(A<=this.clickoutTolerance){this.callback(C,B)
}}else{this.callback(C,B)
}}},activate:function(){var A=false;
if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){this.moveLayerToTop();
this.map.events.on({removelayer:this.handleMapEvents,changelayer:this.handleMapEvents,scope:this});
A=true
}return A
},deactivate:function(){var A=false;
if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){this.moveLayerBack();
this.feature=null;
this.lastFeature=null;
this.down=null;
this.up=null;
this.map.events.un({removelayer:this.handleMapEvents,changelayer:this.handleMapEvents,scope:this});
A=true
}return A
},handleMapEvents:function(A){if(!A.property||A.property=="order"){this.moveLayerToTop()
}},moveLayerToTop:function(){var A=Math.max(this.map.Z_INDEX_BASE.Feature-1,this.layer.getZIndex())+1;
this.layer.setZIndex(A)
},moveLayerBack:function(){var A=this.layer.getZIndex()-1;
if(A>=this.map.Z_INDEX_BASE.Feature){this.layer.setZIndex(A)
}else{this.map.setLayerZIndex(this.layer,this.map.getLayerIndex(this.layer))
}},CLASS_NAME:"OpenLayers.Handler.Feature"});OpenLayers.Handler.Drag=OpenLayers.Class(OpenLayers.Handler,{started:false,stopDown:true,dragging:false,last:null,start:null,oldOnselectstart:null,interval:0,timeoutId:null,initialize:function(C,B,A){OpenLayers.Handler.prototype.initialize.apply(this,arguments)
},down:function(A){},move:function(A){},up:function(A){},out:function(A){},mousedown:function(B){var A=true;
this.dragging=false;
if(this.checkModifiers(B)&&OpenLayers.Event.isLeftClick(B)){this.started=true;
this.start=B.xy;
this.last=B.xy;
OpenLayers.Element.addClass(this.map.div,"olMapDragging");
this.down(B);
this.callback("down",[B.xy]);
OpenLayers.Event.stop(B);
if(!this.oldOnselectstart){this.oldOnselectstart=(document.onselectstart)?document.onselectstart:function(){return true
};
document.onselectstart=function(){return false
}
}A=!this.stopDown
}else{this.started=false;
this.start=null;
this.last=null
}return A
},mousemove:function(A){if(this.started&&!this.timeoutId&&(A.xy.x!=this.last.x||A.xy.y!=this.last.y)){if(this.interval>0){this.timeoutId=setTimeout(OpenLayers.Function.bind(this.removeTimeout,this),this.interval)
}this.dragging=true;
this.move(A);
this.callback("move",[A.xy]);
if(!this.oldOnselectstart){this.oldOnselectstart=document.onselectstart;
document.onselectstart=function(){return false
}
}this.last=this.evt.xy
}return true
},removeTimeout:function(){this.timeoutId=null
},mouseup:function(B){if(this.started){var A=(this.start!=this.last);
this.started=false;
this.dragging=false;
OpenLayers.Element.removeClass(this.map.div,"olMapDragging");
this.up(B);
this.callback("up",[B.xy]);
if(A){this.callback("done",[B.xy])
}document.onselectstart=this.oldOnselectstart
}return true
},mouseout:function(B){if(this.started&&OpenLayers.Util.mouseLeft(B,this.map.div)){var A=(this.start!=this.last);
this.started=false;
this.dragging=false;
OpenLayers.Element.removeClass(this.map.div,"olMapDragging");
this.out(B);
this.callback("out",[]);
if(A){this.callback("done",[B.xy])
}if(document.onselectstart){document.onselectstart=this.oldOnselectstart
}}return true
},click:function(A){return(this.start==this.last)
},activate:function(){var A=false;
if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){this.dragging=false;
A=true
}return A
},deactivate:function(){var A=false;
if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){this.started=false;
this.dragging=false;
this.start=null;
this.last=null;
A=true
}return A
},CLASS_NAME:"OpenLayers.Handler.Drag"});OpenLayers.Handler.RegularPolygon=OpenLayers.Class(OpenLayers.Handler.Drag,{sides:4,radius:null,snapAngle:null,snapToggle:"shiftKey",persist:false,irregular:false,angle:null,fixedRadius:false,feature:null,layer:null,origin:null,initialize:function(C,B,A){this.style=OpenLayers.Util.extend(OpenLayers.Feature.Vector.style["default"],{});
OpenLayers.Handler.prototype.initialize.apply(this,[C,B,A]);
this.options=(A)?A:new Object()
},setOptions:function(A){OpenLayers.Util.extend(this.options,A);
OpenLayers.Util.extend(this,A)
},activate:function(){var A=false;
if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){var B={displayInLayerSwitcher:false,calculateInRange:function(){return true
}};
this.layer=new OpenLayers.Layer.Vector(this.CLASS_NAME,B);
this.map.addLayer(this.layer);
A=true
}return A
},deactivate:function(){var A=false;
if(OpenLayers.Handler.Drag.prototype.deactivate.apply(this,arguments)){if(this.dragging){this.cancel()
}if(this.layer.map!=null){this.layer.destroy(false);
if(this.feature){this.feature.destroy()
}}this.layer=null;
this.feature=null;
A=true
}return A
},down:function(A){this.fixedRadius=!!(this.radius);
var B=this.map.getLonLatFromPixel(A.xy);
this.origin=new OpenLayers.Geometry.Point(B.lon,B.lat);
if(!this.fixedRadius||this.irregular){this.radius=this.map.getResolution()
}if(this.persist){this.clear()
}this.feature=new OpenLayers.Feature.Vector();
this.createGeometry();
this.layer.addFeatures([this.feature],{silent:true});
this.layer.drawFeature(this.feature,this.style)
},move:function(C){var F=this.map.getLonLatFromPixel(C.xy);
var A=new OpenLayers.Geometry.Point(F.lon,F.lat);
if(this.irregular){var G=Math.sqrt(2)*Math.abs(A.y-this.origin.y)/2;
this.radius=Math.max(this.map.getResolution()/2,G)
}else{if(this.fixedRadius){this.origin=A
}else{this.calculateAngle(A,C);
this.radius=Math.max(this.map.getResolution()/2,A.distanceTo(this.origin))
}}this.modifyGeometry();
if(this.irregular){var D=A.x-this.origin.x;
var B=A.y-this.origin.y;
var E;
if(B==0){E=D/(this.radius*Math.sqrt(2))
}else{E=D/B
}this.feature.geometry.resize(1,this.origin,E);
this.feature.geometry.move(D/2,B/2)
}this.layer.drawFeature(this.feature,this.style)
},up:function(A){this.finalize()
},out:function(A){this.finalize()
},createGeometry:function(){this.angle=Math.PI*((1/this.sides)-(1/2));
if(this.snapAngle){this.angle+=this.snapAngle*(Math.PI/180)
}this.feature.geometry=OpenLayers.Geometry.Polygon.createRegularPolygon(this.origin,this.radius,this.sides,this.snapAngle)
},modifyGeometry:function(){var F,C,B,A;
var D=this.feature.geometry.components[0];
if(D.components.length!=(this.sides+1)){this.createGeometry();
D=this.feature.geometry.components[0]
}for(var E=0;
E<this.sides;
++E){A=D.components[E];
F=this.angle+(E*2*Math.PI/this.sides);
A.x=this.origin.x+(this.radius*Math.cos(F));
A.y=this.origin.y+(this.radius*Math.sin(F));
A.clearBounds()
}},calculateAngle:function(A,B){var D=Math.atan2(A.y-this.origin.y,A.x-this.origin.x);
if(this.snapAngle&&(this.snapToggle&&!B[this.snapToggle])){var C=(Math.PI/180)*this.snapAngle;
this.angle=Math.round(D/C)*C
}else{this.angle=D
}},cancel:function(){this.callback("cancel",null);
this.finalize()
},finalize:function(){this.origin=null;
this.radius=this.options.radius
},clear:function(){this.layer.renderer.clear();
this.layer.destroyFeatures()
},callback:function(B,A){if(this.callbacks[B]){this.callbacks[B].apply(this.control,[this.feature.geometry.clone()])
}if(!this.persist&&(B=="done"||B=="cancel")){this.clear()
}},CLASS_NAME:"OpenLayers.Handler.RegularPolygon"});OpenLayers.Handler.Box=OpenLayers.Class(OpenLayers.Handler,{dragHandler:null,boxDivClassName:"olHandlerBoxZoomBox",boxCharacteristics:null,initialize:function(C,B,A){OpenLayers.Handler.prototype.initialize.apply(this,arguments);
var B={down:this.startBox,move:this.moveBox,out:this.removeBox,up:this.endBox};
this.dragHandler=new OpenLayers.Handler.Drag(this,B,{keyMask:this.keyMask})
},setMap:function(A){OpenLayers.Handler.prototype.setMap.apply(this,arguments);
if(this.dragHandler){this.dragHandler.setMap(A)
}},startBox:function(A){this.zoomBox=OpenLayers.Util.createDiv("zoomBox",this.dragHandler.start);
this.zoomBox.className=this.boxDivClassName;
this.zoomBox.style.zIndex=this.map.Z_INDEX_BASE.Popup-1;
this.map.viewPortDiv.appendChild(this.zoomBox);
this.map.div.style.cursor="crosshair"
},moveBox:function(F){var D=this.dragHandler.start.x;
var B=this.dragHandler.start.y;
var C=Math.abs(D-F.x);
var A=Math.abs(B-F.y);
this.zoomBox.style.width=Math.max(1,C)+"px";
this.zoomBox.style.height=Math.max(1,A)+"px";
this.zoomBox.style.left=F.x<D?F.x+"px":D+"px";
this.zoomBox.style.top=F.y<B?F.y+"px":B+"px";
var E=this.getBoxCharacteristics(C,A);
if(E.newBoxModel){if(F.x>D){this.zoomBox.style.width=Math.max(1,C-E.xOffset)+"px"
}if(F.y>B){this.zoomBox.style.height=Math.max(1,A-E.yOffset)+"px"
}}},endBox:function(B){var A;
if(Math.abs(this.dragHandler.start.x-B.x)>5||Math.abs(this.dragHandler.start.y-B.y)>5){var G=this.dragHandler.start;
var F=Math.min(G.y,B.y);
var C=Math.max(G.y,B.y);
var E=Math.min(G.x,B.x);
var D=Math.max(G.x,B.x);
A=new OpenLayers.Bounds(E,C,D,F)
}else{A=this.dragHandler.start.clone()
}this.removeBox();
this.map.div.style.cursor="";
this.callback("done",[A])
},removeBox:function(){this.map.viewPortDiv.removeChild(this.zoomBox);
this.zoomBox=null;
this.boxCharacteristics=null
},activate:function(){if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){this.dragHandler.activate();
return true
}else{return false
}},deactivate:function(){if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){this.dragHandler.deactivate();
return true
}else{return false
}},getBoxCharacteristics:function(B,A){if(!this.boxCharacteristics){var C=parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-left-width"))+parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-right-width"))+1;
var E=parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-top-width"))+parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-bottom-width"))+1;
var D=OpenLayers.Util.getBrowserName()=="msie"?document.compatMode!="BackCompat":true;
this.boxCharacteristics={xOffset:C,yOffset:E,newBoxModel:D}
}return this.boxCharacteristics
},CLASS_NAME:"OpenLayers.Handler.Box"});OpenLayers.Handler.MouseWheel=OpenLayers.Class(OpenLayers.Handler,{wheelListener:null,mousePosition:null,initialize:function(C,B,A){OpenLayers.Handler.prototype.initialize.apply(this,arguments);
this.wheelListener=OpenLayers.Function.bindAsEventListener(this.onWheelEvent,this)
},destroy:function(){OpenLayers.Handler.prototype.destroy.apply(this,arguments);
this.wheelListener=null
},onWheelEvent:function(I){if(!this.map||!this.checkModifiers(I)){return 
}var F=false;
var J=false;
var E=false;
var B=OpenLayers.Event.element(I);
while((B!=null)&&!E&&!F){if(!F){try{if(B.currentStyle){C=B.currentStyle.overflow
}else{var A=document.defaultView.getComputedStyle(B,null);
var C=A.getPropertyValue("overflow")
}F=(C&&(C=="auto")||(C=="scroll"))
}catch(D){}}if(!J){for(var G=0,H=this.map.layers.length;
G<H;
G++){if(B==this.map.layers[G].div||B==this.map.layers[G].pane){J=true;
break
}}}E=(B==this.map.div);
B=B.parentNode
}if(!F&&E){if(J){this.wheelZoom(I)
}OpenLayers.Event.stop(I)
}},wheelZoom:function(A){var B=0;
if(!A){A=window.event
}if(A.wheelDelta){B=A.wheelDelta/120;
if(window.opera&&window.opera.version()<9.2){B=-B
}}else{if(A.detail){B=-A.detail/3
}}if(B){if(this.mousePosition){A.xy=this.mousePosition
}if(!A.xy){A.xy=this.map.getPixelFromLonLat(this.map.getCenter())
}if(B<0){this.callback("down",[A,B])
}else{this.callback("up",[A,B])
}}},mousemove:function(A){this.mousePosition=A.xy
},activate:function(A){if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){var B=this.wheelListener;
OpenLayers.Event.observe(window,"DOMMouseScroll",B);
OpenLayers.Event.observe(window,"mousewheel",B);
OpenLayers.Event.observe(document,"mousewheel",B);
return true
}else{return false
}},deactivate:function(A){if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){var B=this.wheelListener;
OpenLayers.Event.stopObserving(window,"DOMMouseScroll",B);
OpenLayers.Event.stopObserving(window,"mousewheel",B);
OpenLayers.Event.stopObserving(document,"mousewheel",B);
return true
}else{return false
}},CLASS_NAME:"OpenLayers.Handler.MouseWheel"});OpenLayers.Handler.Keyboard=OpenLayers.Class(OpenLayers.Handler,{KEY_EVENTS:["keydown","keyup"],eventListener:null,initialize:function(C,B,A){OpenLayers.Handler.prototype.initialize.apply(this,arguments);
this.eventListener=OpenLayers.Function.bindAsEventListener(this.handleKeyEvent,this)
},destroy:function(){this.deactivate();
this.eventListener=null;
OpenLayers.Handler.prototype.destroy.apply(this,arguments)
},activate:function(){if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){for(var B=0,A=this.KEY_EVENTS.length;
B<A;
B++){OpenLayers.Event.observe(document,this.KEY_EVENTS[B],this.eventListener)
}return true
}else{return false
}},deactivate:function(){var C=false;
if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){for(var B=0,A=this.KEY_EVENTS.length;
B<A;
B++){OpenLayers.Event.stopObserving(document,this.KEY_EVENTS[B],this.eventListener)
}C=true
}return C
},handleKeyEvent:function(A){if(this.checkModifiers(A)){this.callback(A.type,[A])
}},CLASS_NAME:"OpenLayers.Handler.Keyboard"});OpenLayers.Control=OpenLayers.Class({id:null,map:null,div:null,type:null,allowSelection:false,displayClass:"",title:"",active:null,handler:null,eventListeners:null,events:null,EVENT_TYPES:["activate","deactivate"],initialize:function(A){this.displayClass=this.CLASS_NAME.replace("OpenLayers.","ol").replace(/\./g,"");
OpenLayers.Util.extend(this,A);
this.events=new OpenLayers.Events(this,null,this.EVENT_TYPES);
if(this.eventListeners instanceof Object){this.events.on(this.eventListeners)
}if(this.id==null){this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")
}},destroy:function(){if(this.events){if(this.eventListeners){this.events.un(this.eventListeners)
}this.events.destroy();
this.events=null
}this.eventListeners=null;
if(this.handler){this.handler.destroy();
this.handler=null
}if(this.handlers){for(var A in this.handlers){if(this.handlers.hasOwnProperty(A)&&typeof this.handlers[A].destroy=="function"){this.handlers[A].destroy()
}}this.handlers=null
}if(this.map){this.map.removeControl(this);
this.map=null
}},setMap:function(A){this.map=A;
if(this.handler){this.handler.setMap(A)
}},draw:function(A){if(this.div==null){this.div=OpenLayers.Util.createDiv(this.id);
this.div.className=this.displayClass;
if(!this.allowSelection){this.div.className+=" olControlNoSelect";
this.div.setAttribute("unselectable","on",0);
this.div.onselectstart=function(){return(false)
}
}if(this.title!=""){this.div.title=this.title
}}if(A!=null){this.position=A.clone()
}this.moveTo(this.position);
return this.div
},moveTo:function(A){if((A!=null)&&(this.div!=null)){this.div.style.left=A.x+"px";
this.div.style.top=A.y+"px"
}},activate:function(){if(this.active){return false
}if(this.handler){this.handler.activate()
}this.active=true;
this.events.triggerEvent("activate");
return true
},deactivate:function(){if(this.active){if(this.handler){this.handler.deactivate()
}this.active=false;
this.events.triggerEvent("deactivate");
return true
}return false
},CLASS_NAME:"OpenLayers.Control"});
OpenLayers.Control.TYPE_BUTTON=1;
OpenLayers.Control.TYPE_TOGGLE=2;
OpenLayers.Control.TYPE_TOOL=3;OpenLayers.Control.Attribution=OpenLayers.Class(OpenLayers.Control,{separator:", ",initialize:function(A){OpenLayers.Control.prototype.initialize.apply(this,arguments)
},destroy:function(){this.map.events.un({removelayer:this.updateAttribution,addlayer:this.updateAttribution,changelayer:this.updateAttribution,changebaselayer:this.updateAttribution,scope:this});
OpenLayers.Control.prototype.destroy.apply(this,arguments)
},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);
this.map.events.on({changebaselayer:this.updateAttribution,changelayer:this.updateAttribution,addlayer:this.updateAttribution,removelayer:this.updateAttribution,scope:this});
this.updateAttribution();
return this.div
},updateAttribution:function(){var D=[];
if(this.map&&this.map.layers){for(var C=0,A=this.map.layers.length;
C<A;
C++){var B=this.map.layers[C];
if(B.attribution&&B.getVisibility()){D.push(B.attribution)
}}this.div.innerHTML=D.join(this.separator)
}},CLASS_NAME:"OpenLayers.Control.Attribution"});OpenLayers.Control.Button=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_BUTTON,trigger:function(){},CLASS_NAME:"OpenLayers.Control.Button"});OpenLayers.Control.ZoomBox=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_TOOL,out:false,draw:function(){this.handler=new OpenLayers.Handler.Box(this,{done:this.zoomBox},{keyMask:this.keyMask})
},zoomBox:function(H){if(H instanceof OpenLayers.Bounds){if(!this.out){var I=this.map.getLonLatFromPixel(new OpenLayers.Pixel(H.left,H.bottom));
var L=this.map.getLonLatFromPixel(new OpenLayers.Pixel(H.right,H.top));
var B=new OpenLayers.Bounds(I.lon,I.lat,L.lon,L.lat)
}else{var G=Math.abs(H.right-H.left);
var J=Math.abs(H.top-H.bottom);
var E=Math.min((this.map.size.h/J),(this.map.size.w/G));
var M=this.map.getExtent();
var A=this.map.getLonLatFromPixel(H.getCenterPixel());
var C=A.lon-(M.getWidth()/2)*E;
var F=A.lon+(M.getWidth()/2)*E;
var K=A.lat-(M.getHeight()/2)*E;
var D=A.lat+(M.getHeight()/2)*E;
var B=new OpenLayers.Bounds(C,K,F,D)
}this.map.zoomToExtent(B)
}else{if(!this.out){this.map.setCenter(this.map.getLonLatFromPixel(H),this.map.getZoom()+1)
}else{this.map.setCenter(this.map.getLonLatFromPixel(H),this.map.getZoom()-1)
}}},CLASS_NAME:"OpenLayers.Control.ZoomBox"});OpenLayers.Control.ZoomToMaxExtent=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_BUTTON,trigger:function(){if(this.map){this.map.zoomToMaxExtent()
}},CLASS_NAME:"OpenLayers.Control.ZoomToMaxExtent"});OpenLayers.Control.DragPan=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_TOOL,panned:false,interval:25,draw:function(){this.handler=new OpenLayers.Handler.Drag(this,{move:this.panMap,done:this.panMapDone},{interval:this.interval})
},panMap:function(A){this.panned=true;
this.map.pan(this.handler.last.x-A.x,this.handler.last.y-A.y,{dragging:this.handler.dragging,animate:false})
},panMapDone:function(A){if(this.panned){this.panMap(A);
this.panned=false
}},CLASS_NAME:"OpenLayers.Control.DragPan"});OpenLayers.Control.Navigation=OpenLayers.Class(OpenLayers.Control,{dragPan:null,dragPanOptions:null,zoomBox:null,zoomWheelEnabled:true,handleRightClicks:false,initialize:function(A){this.handlers={};
OpenLayers.Control.prototype.initialize.apply(this,arguments)
},destroy:function(){this.deactivate();
if(this.dragPan){this.dragPan.destroy()
}this.dragPan=null;
if(this.zoomBox){this.zoomBox.destroy()
}this.zoomBox=null;
OpenLayers.Control.prototype.destroy.apply(this,arguments)
},activate:function(){this.dragPan.activate();
if(this.zoomWheelEnabled){this.handlers.wheel.activate()
}this.handlers.click.activate();
this.zoomBox.activate();
return OpenLayers.Control.prototype.activate.apply(this,arguments)
},deactivate:function(){this.zoomBox.deactivate();
this.dragPan.deactivate();
this.handlers.click.deactivate();
this.handlers.wheel.deactivate();
return OpenLayers.Control.prototype.deactivate.apply(this,arguments)
},draw:function(){if(this.handleRightClicks){this.map.div.oncontextmenu=function(){return false
}
}var A={dblclick:this.defaultDblClick,dblrightclick:this.defaultDblRightClick};
var B={"double":true,stopDouble:true};
this.handlers.click=new OpenLayers.Handler.Click(this,A,B);
this.dragPan=new OpenLayers.Control.DragPan(OpenLayers.Util.extend({map:this.map},this.dragPanOptions));
this.zoomBox=new OpenLayers.Control.ZoomBox({map:this.map,keyMask:OpenLayers.Handler.MOD_SHIFT});
this.dragPan.draw();
this.zoomBox.draw();
this.handlers.wheel=new OpenLayers.Handler.MouseWheel(this,{up:this.wheelUp,down:this.wheelDown});
this.activate()
},defaultDblClick:function(B){var A=this.map.getLonLatFromViewPortPx(B.xy);
this.map.setCenter(A,this.map.zoom+1)
},defaultDblRightClick:function(B){var A=this.map.getLonLatFromViewPortPx(B.xy);
this.map.setCenter(A,this.map.zoom-1)
},wheelChange:function(H,C){var F=this.map.getZoom()+C;
if(!this.map.isValidZoomLevel(F)){return 
}var I=this.map.getSize();
var E=I.w/2-H.xy.x;
var D=H.xy.y-I.h/2;
var G=this.map.baseLayer.getResolutionForZoom(F);
var A=this.map.getLonLatFromPixel(H.xy);
var B=new OpenLayers.LonLat(A.lon+E*G,A.lat+D*G);
this.map.setCenter(B,F)
},wheelUp:function(A){this.wheelChange(A,1)
},wheelDown:function(A){this.wheelChange(A,-1)
},disableZoomWheel:function(){this.zoomWheelEnabled=false;
this.handlers.wheel.deactivate()
},enableZoomWheel:function(){this.zoomWheelEnabled=true;
if(this.active){this.handlers.wheel.activate()
}},CLASS_NAME:"OpenLayers.Control.Navigation"});OpenLayers.Control.MouseDefaults=OpenLayers.Class(OpenLayers.Control,{performedDrag:false,wheelObserver:null,initialize:function(){OpenLayers.Control.prototype.initialize.apply(this,arguments)
},destroy:function(){if(this.handler){this.handler.destroy()
}this.handler=null;
this.map.events.un({click:this.defaultClick,dblclick:this.defaultDblClick,mousedown:this.defaultMouseDown,mouseup:this.defaultMouseUp,mousemove:this.defaultMouseMove,mouseout:this.defaultMouseOut,scope:this});
OpenLayers.Event.stopObserving(window,"DOMMouseScroll",this.wheelObserver);
OpenLayers.Event.stopObserving(window,"mousewheel",this.wheelObserver);
OpenLayers.Event.stopObserving(document,"mousewheel",this.wheelObserver);
this.wheelObserver=null;
OpenLayers.Control.prototype.destroy.apply(this,arguments)
},draw:function(){this.map.events.on({click:this.defaultClick,dblclick:this.defaultDblClick,mousedown:this.defaultMouseDown,mouseup:this.defaultMouseUp,mousemove:this.defaultMouseMove,mouseout:this.defaultMouseOut,scope:this});
this.registerWheelEvents()
},registerWheelEvents:function(){this.wheelObserver=OpenLayers.Function.bindAsEventListener(this.onWheelEvent,this);
OpenLayers.Event.observe(window,"DOMMouseScroll",this.wheelObserver);
OpenLayers.Event.observe(window,"mousewheel",this.wheelObserver);
OpenLayers.Event.observe(document,"mousewheel",this.wheelObserver)
},defaultClick:function(B){if(!OpenLayers.Event.isLeftClick(B)){return 
}var A=!this.performedDrag;
this.performedDrag=false;
return A
},defaultDblClick:function(B){var A=this.map.getLonLatFromViewPortPx(B.xy);
this.map.setCenter(A,this.map.zoom+1);
OpenLayers.Event.stop(B);
return false
},defaultMouseDown:function(A){if(!OpenLayers.Event.isLeftClick(A)){return 
}this.mouseDragStart=A.xy.clone();
this.performedDrag=false;
if(A.shiftKey){this.map.div.style.cursor="crosshair";
this.zoomBox=OpenLayers.Util.createDiv("zoomBox",this.mouseDragStart,null,null,"absolute","2px solid red");
this.zoomBox.style.backgroundColor="white";
this.zoomBox.style.filter="alpha(opacity=50)";
this.zoomBox.style.opacity="0.50";
this.zoomBox.style.fontSize="1px";
this.zoomBox.style.zIndex=this.map.Z_INDEX_BASE.Popup-1;
this.map.viewPortDiv.appendChild(this.zoomBox)
}document.onselectstart=function(){return false
};
OpenLayers.Event.stop(A)
},defaultMouseMove:function(E){this.mousePosition=E.xy.clone();
if(this.mouseDragStart!=null){if(this.zoomBox){var D=Math.abs(this.mouseDragStart.x-E.xy.x);
var B=Math.abs(this.mouseDragStart.y-E.xy.y);
this.zoomBox.style.width=Math.max(1,D)+"px";
this.zoomBox.style.height=Math.max(1,B)+"px";
if(E.xy.x<this.mouseDragStart.x){this.zoomBox.style.left=E.xy.x+"px"
}if(E.xy.y<this.mouseDragStart.y){this.zoomBox.style.top=E.xy.y+"px"
}}else{var D=this.mouseDragStart.x-E.xy.x;
var B=this.mouseDragStart.y-E.xy.y;
var F=this.map.getSize();
var A=new OpenLayers.Pixel(F.w/2+D,F.h/2+B);
var C=this.map.getLonLatFromViewPortPx(A);
this.map.setCenter(C,null,true);
this.mouseDragStart=E.xy.clone();
this.map.div.style.cursor="move"
}this.performedDrag=true
}},defaultMouseUp:function(A){if(!OpenLayers.Event.isLeftClick(A)){return 
}if(this.zoomBox){this.zoomBoxEnd(A)
}else{if(this.performedDrag){this.map.setCenter(this.map.center)
}}document.onselectstart=null;
this.mouseDragStart=null;
this.map.div.style.cursor=""
},defaultMouseOut:function(A){if(this.mouseDragStart!=null&&OpenLayers.Util.mouseLeft(A,this.map.div)){if(this.zoomBox){this.removeZoomBox()
}this.mouseDragStart=null
}},defaultWheelUp:function(A){if(this.map.getZoom()<=this.map.getNumZoomLevels()){this.map.setCenter(this.map.getLonLatFromPixel(A.xy),this.map.getZoom()+1)
}},defaultWheelDown:function(A){if(this.map.getZoom()>0){this.map.setCenter(this.map.getLonLatFromPixel(A.xy),this.map.getZoom()-1)
}},zoomBoxEnd:function(B){if(this.mouseDragStart!=null){if(Math.abs(this.mouseDragStart.x-B.xy.x)>5||Math.abs(this.mouseDragStart.y-B.xy.y)>5){var H=this.map.getLonLatFromViewPortPx(this.mouseDragStart);
var A=this.map.getLonLatFromViewPortPx(B.xy);
var G=Math.max(H.lat,A.lat);
var C=Math.min(H.lat,A.lat);
var F=Math.min(H.lon,A.lon);
var D=Math.max(H.lon,A.lon);
var E=new OpenLayers.Bounds(F,C,D,G);
this.map.zoomToExtent(E)
}else{var A=this.map.getLonLatFromViewPortPx(B.xy);
this.map.setCenter(new OpenLayers.LonLat((A.lon),(A.lat)),this.map.getZoom()+1)
}this.removeZoomBox()
}},removeZoomBox:function(){this.map.viewPortDiv.removeChild(this.zoomBox);
this.zoomBox=null
},onWheelEvent:function(C){var B=false;
var A=OpenLayers.Event.element(C);
while(A!=null){if(this.map&&A==this.map.div){B=true;
break
}A=A.parentNode
}if(B){var D=0;
if(!C){C=window.event
}if(C.wheelDelta){D=C.wheelDelta/120;
if(window.opera&&window.opera.version()<9.2){D=-D
}}else{if(C.detail){D=-C.detail/3
}}if(D){C.xy=this.mousePosition;
if(D<0){this.defaultWheelDown(C)
}else{this.defaultWheelUp(C)
}}OpenLayers.Event.stop(C)
}},CLASS_NAME:"OpenLayers.Control.MouseDefaults"});OpenLayers.Control.MousePosition=OpenLayers.Class(OpenLayers.Control,{element:null,prefix:"",separator:", ",suffix:"",numDigits:5,granularity:10,lastXy:null,displayProjection:null,initialize:function(A){OpenLayers.Control.prototype.initialize.apply(this,arguments)
},destroy:function(){if(this.map){this.map.events.unregister("mousemove",this,this.redraw)
}OpenLayers.Control.prototype.destroy.apply(this,arguments)
},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);
if(!this.element){this.div.left="";
this.div.top="";
this.element=this.div
}this.redraw();
return this.div
},redraw:function(A){var C;
if(A==null){C=new OpenLayers.LonLat(0,0)
}else{if(this.lastXy==null||Math.abs(A.xy.x-this.lastXy.x)>this.granularity||Math.abs(A.xy.y-this.lastXy.y)>this.granularity){this.lastXy=A.xy;
return 
}C=this.map.getLonLatFromPixel(A.xy);
if(!C){return 
}if(this.displayProjection){C.transform(this.map.getProjectionObject(),this.displayProjection)
}this.lastXy=A.xy
}var B=this.formatOutput(C);
if(B!=this.element.innerHTML){this.element.innerHTML=B
}},formatOutput:function(B){var C=parseInt(this.numDigits);
var A=this.prefix+B.lon.toFixed(C)+this.separator+B.lat.toFixed(C)+this.suffix;
return A
},setMap:function(){OpenLayers.Control.prototype.setMap.apply(this,arguments);
this.map.events.register("mousemove",this,this.redraw)
},CLASS_NAME:"OpenLayers.Control.MousePosition"});OpenLayers.Control.KeyboardDefaults=OpenLayers.Class(OpenLayers.Control,{slideFactor:75,initialize:function(){OpenLayers.Control.prototype.initialize.apply(this,arguments)
},destroy:function(){if(this.handler){this.handler.destroy()
}this.handler=null;
OpenLayers.Control.prototype.destroy.apply(this,arguments)
},draw:function(){this.handler=new OpenLayers.Handler.Keyboard(this,{keydown:this.defaultKeyPress});
this.activate()
},defaultKeyPress:function(A){if(A.shiftKey&&A.altKey){switch(A.keyCode){case OpenLayers.Event.KEY_LEFT:case 74:this.map.pan(-this.slideFactor,0);
break;
case 76:case OpenLayers.Event.KEY_RIGHT:this.map.pan(this.slideFactor,0);
break;
case 73:case OpenLayers.Event.KEY_UP:this.map.pan(0,-this.slideFactor);
break;
case 75:case OpenLayers.Event.KEY_DOWN:this.map.pan(0,this.slideFactor);
break
}}switch(A.keyCode){case 43:case 61:case 187:case 107:this.map.zoomIn();
break;
case 45:case 109:case 189:case 95:this.map.zoomOut();
break
}},CLASS_NAME:"OpenLayers.Control.KeyboardDefaults"});OpenLayers.Control.PanZoom=OpenLayers.Class(OpenLayers.Control,{slideFactor:50,buttons:null,position:null,initialize:function(A){this.position=new OpenLayers.Pixel(OpenLayers.Control.PanZoom.X,OpenLayers.Control.PanZoom.Y);
OpenLayers.Control.prototype.initialize.apply(this,arguments)
},destroy:function(){OpenLayers.Control.prototype.destroy.apply(this,arguments);
while(this.buttons.length){var A=this.buttons.shift();
A.map=null;
OpenLayers.Event.stopObservingElement(A)
}this.buttons=null;
this.position=null
},draw:function(B){OpenLayers.Control.prototype.draw.apply(this,arguments);
B=new OpenLayers.Pixel(0,0);
this.buttons=[];
var C=new OpenLayers.Size(18,18);
var A=new OpenLayers.Pixel(B.x+C.w/2,B.y);
this._addButton("panup","north-mini.png",A,C);
B.y=A.y+C.h;
this._addButton("panleft","west-mini.png",B,C);
this._addButton("panright","east-mini.png",B.add(C.w,0),C);
this._addButton("pandown","south-mini.png",A.add(0,C.h*2),C);
this._addButton("zoomin","zoom-plus-mini.png",A.add(0,C.h*3+5),C);
this._addButton("zoomworld","zoom-world-mini.png",A.add(0,C.h*4+5),C);
this._addButton("zoomout","zoom-minus-mini.png",A.add(0,C.h*5+5),C);
return this.div
},_addButton:function(F,A,E,D){var C=OpenLayers.Util.getImagesLocation()+A;
var B=OpenLayers.Util.createAlphaImageDiv(this.id+"_"+F,E,D,C,"absolute");
this.div.appendChild(B);
OpenLayers.Event.observe(B,"mousedown",OpenLayers.Function.bindAsEventListener(this.buttonDown,B));
OpenLayers.Event.observe(B,"dblclick",OpenLayers.Function.bindAsEventListener(this.doubleClick,B));
OpenLayers.Event.observe(B,"click",OpenLayers.Function.bindAsEventListener(this.doubleClick,B));
B.action=F;
B.map=this.map;
B.slideFactor=this.slideFactor;
this.buttons.push(B);
return B
},doubleClick:function(A){OpenLayers.Event.stop(A);
return false
},buttonDown:function(A){if(!OpenLayers.Event.isLeftClick(A)){return 
}switch(this.action){case"panup":this.map.pan(0,-this.slideFactor);
break;
case"pandown":this.map.pan(0,this.slideFactor);
break;
case"panleft":this.map.pan(-this.slideFactor,0);
break;
case"panright":this.map.pan(this.slideFactor,0);
break;
case"zoomin":this.map.zoomIn();
break;
case"zoomout":this.map.zoomOut();
break;
case"zoomworld":break
}OpenLayers.Event.stop(A)
},CLASS_NAME:"OpenLayers.Control.PanZoom"});
OpenLayers.Control.PanZoom.X=4;
OpenLayers.Control.PanZoom.Y=4;OpenLayers.Control.PanZoomBar=OpenLayers.Class(OpenLayers.Control.PanZoom,{zoomStopWidth:18,zoomStopHeight:11,slider:null,sliderEvents:null,zoomBarDiv:null,divEvents:null,zoomWorldIcon:false,initialize:function(){OpenLayers.Control.PanZoom.prototype.initialize.apply(this,arguments)
},destroy:function(){this.div.removeChild(this.slider);
this.slider=null;
this.sliderEvents.destroy();
this.sliderEvents=null;
this.div.removeChild(this.zoombarDiv);
this.zoomBarDiv=null;
this.divEvents.destroy();
this.divEvents=null;
this.map.events.un({zoomend:this.moveZoomBar,changebaselayer:this.redraw,scope:this});
OpenLayers.Control.PanZoom.prototype.destroy.apply(this,arguments)
},setMap:function(A){OpenLayers.Control.PanZoom.prototype.setMap.apply(this,arguments);
this.map.events.register("changebaselayer",this,this.redraw)
},redraw:function(){if(this.div!=null){this.div.innerHTML=""
}this.draw()
},draw:function(B){OpenLayers.Control.prototype.draw.apply(this,arguments);
B=new OpenLayers.Pixel(0,0);
this.buttons=[];
var D=new OpenLayers.Size(18,18);
var A=new OpenLayers.Pixel(B.x+D.w/2,B.y);
var C=D.w;
if(this.zoomWorldIcon){A=new OpenLayers.Pixel(B.x+D.w,B.y)
}this._addButton("panup","north-mini.png",A,D);
B.y=A.y+D.h;
this._addButton("panleft","west-mini.png",B,D);
if(this.zoomWorldIcon){this._addButton("zoomworld","zoom-world-mini.png",B.add(D.w,0),D);
C*=2
}this._addButton("panright","east-mini.png",B.add(C,0),D);
this._addButton("pandown","south-mini.png",A.add(0,D.h*2),D);
this._addButton("zoomin","zoom-plus-mini.png",A.add(0,D.h*3+5),D);
A=this._addZoomBar(A.add(0,D.h*4+5));
this._addButton("zoomout","zoom-minus-mini.png",A,D);
return this.div
},_addZoomBar:function(A){var E=OpenLayers.Util.getImagesLocation();
var G=this.id+"_"+this.map.id;
var B=this.map.getNumZoomLevels()-1-this.map.getZoom();
var C=OpenLayers.Util.createAlphaImageDiv(G,A.add(-1,B*this.zoomStopHeight),new OpenLayers.Size(20,9),E+"slider.png","absolute");
this.slider=C;
this.sliderEvents=new OpenLayers.Events(this,C,null,true,{includeXY:true});
this.sliderEvents.on({mousedown:this.zoomBarDown,mousemove:this.zoomBarDrag,mouseup:this.zoomBarUp,dblclick:this.doubleClick,click:this.doubleClick});
var D=new OpenLayers.Size();
D.h=this.zoomStopHeight*this.map.getNumZoomLevels();
D.w=this.zoomStopWidth;
var F=null;
if(OpenLayers.Util.alphaHack()){var G=this.id+"_"+this.map.id;
F=OpenLayers.Util.createAlphaImageDiv(G,A,new OpenLayers.Size(D.w,this.zoomStopHeight),E+"zoombar.png","absolute",null,"crop");
F.style.height=D.h+"px"
}else{F=OpenLayers.Util.createDiv("OpenLayers_Control_PanZoomBar_Zoombar"+this.map.id,A,D,E+"zoombar.png")
}this.zoombarDiv=F;
this.divEvents=new OpenLayers.Events(this,F,null,true,{includeXY:true});
this.divEvents.on({mousedown:this.divClick,mousemove:this.passEventToSlider,dblclick:this.doubleClick,click:this.doubleClick});
this.div.appendChild(F);
this.startTop=parseInt(F.style.top);
this.div.appendChild(C);
this.map.events.register("zoomend",this,this.moveZoomBar);
A=A.add(0,this.zoomStopHeight*this.map.getNumZoomLevels());
return A
},passEventToSlider:function(A){this.sliderEvents.handleBrowserEvent(A)
},divClick:function(A){if(!OpenLayers.Event.isLeftClick(A)){return 
}var E=A.xy.y;
var D=OpenLayers.Util.pagePosition(A.object)[1];
var C=(E-D)/this.zoomStopHeight;
if(!this.map.fractionalZoom){C=Math.floor(C)
}var B=(this.map.getNumZoomLevels()-1)-C;
B=Math.min(Math.max(B,0),this.map.getNumZoomLevels()-1);
this.map.zoomTo(B);
OpenLayers.Event.stop(A)
},zoomBarDown:function(A){if(!OpenLayers.Event.isLeftClick(A)){return 
}this.map.events.on({mousemove:this.passEventToSlider,mouseup:this.passEventToSlider,scope:this});
this.mouseDragStart=A.xy.clone();
this.zoomStart=A.xy.clone();
this.div.style.cursor="move";
this.zoombarDiv.offsets=null;
OpenLayers.Event.stop(A)
},zoomBarDrag:function(B){if(this.mouseDragStart!=null){var A=this.mouseDragStart.y-B.xy.y;
var D=OpenLayers.Util.pagePosition(this.zoombarDiv);
if((B.clientY-D[1])>0&&(B.clientY-D[1])<parseInt(this.zoombarDiv.style.height)-2){var C=parseI;
nt(this.slider.style.top)-A;
this.slider.style.top=C+"px"
}this.mouseDragStart=B.xy.clone();
OpenLayers.Event.stop(B)
}},zoomBarUp:function(B){if(!OpenLayers.Event.isLeftClick(B)){return 
}if(this.zoomStart){this.div.style.cursor="";
this.map.events.un({mouseup:this.passEventToSlider,mousemove:this.passEventToSlider,scope:this});
var A=this.zoomStart.y-B.xy.y;
var C=this.map.zoom;
if(this.map.fractionalZoom){C+=A/this.zoomStopHeight;
C=Math.min(Math.max(C,0),this.map.getNumZoomLevels()-1)
}else{C+=Math.round(A/this.zoomStopHeight)
}this.map.zoomTo(C);
this.moveZoomBar();
this.mouseDragStart=null;
OpenLayers.Event.stop(B)
}},moveZoomBar:function(){var A=((this.map.getNumZoomLevels()-1)-this.map.getZoom())*this.zoomStopHeight+this.startTop+1;
this.slider.style.top=A+"px"
},CLASS_NAME:"OpenLayers.Control.PanZoomBar"});OpenLayers.Control.ArgParser=OpenLayers.Class(OpenLayers.Control,{center:null,zoom:null,layers:null,displayProjection:null,initialize:function(A){OpenLayers.Control.prototype.initialize.apply(this,arguments)
},setMap:function(E){OpenLayers.Control.prototype.setMap.apply(this,arguments);
for(var C=0,A=this.map.controls.length;
C<A;
C++){var D=this.map.controls[C];
if((D!=this)&&(D.CLASS_NAME=="OpenLayers.Control.ArgParser")){if(D.displayProjection!=this.displayProjection){this.displayProjection=D.displayProjection
}break
}}if(C==this.map.controls.length){var B=OpenLayers.Util.getParameters();
if(B.layers){this.layers=B.layers;
this.map.events.register("addlayer",this,this.configureLayers);
this.configureLayers()
}if(B.lat&&B.lon){this.center=new OpenLayers.LonLat(parseFloat(B.lon),parseFloat(B.lat));
if(B.zoom){this.zoom=parseInt(B.zoom)
}this.map.events.register("changebaselayer",this,this.setCenter);
this.setCenter()
}}},setCenter:function(){if(this.map.baseLayer){this.map.events.unregister("changebaselayer",this,this.setCenter);
if(this.displayProjection){this.center.transform(this.displayProjection,this.map.getProjectionObject())
}this.map.setCenter(this.center,this.zoom)
}},configureLayers:function(){if(this.layers.length==this.map.layers.length){this.map.events.unregister("addlayer",this,this.configureLayers);
for(var C=0,A=this.layers.length;
C<A;
C++){var B=this.map.layers[C];
var D=this.layers.charAt(C);
if(D=="B"){this.map.setBaseLayer(B)
}else{if((D=="T")||(D=="F")){B.setVisibility(D=="T")
}}}}},CLASS_NAME:"OpenLayers.Control.ArgParser"});OpenLayers.Control.Scale=OpenLayers.Class(OpenLayers.Control,{element:null,initialize:function(B,A){OpenLayers.Control.prototype.initialize.apply(this,[A]);
this.element=OpenLayers.Util.getElement(B)
},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);
if(!this.element){this.element=document.createElement("div");
this.div.appendChild(this.element)
}this.map.events.register("moveend",this,this.updateScale);
this.updateScale();
return this.div
},updateScale:function(){var A=this.map.getScale();
if(!A){return 
}if(A>=9500&&A<=950000){A=Math.round(A/1000)+"K"
}else{if(A>=950000){A=Math.round(A/1000000)+"M"
}else{A=Math.round(A)
}}this.element.innerHTML=OpenLayers.i18n("scale",{scaleDenom:A})
},CLASS_NAME:"OpenLayers.Control.Scale"});OpenLayers.Control.ScaleLine=OpenLayers.Class(OpenLayers.Control,{maxWidth:100,topOutUnits:"km",topInUnits:"m",bottomOutUnits:"mi",bottomInUnits:"ft",eTop:null,eBottom:null,initialize:function(A){OpenLayers.Control.prototype.initialize.apply(this,[A])
},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);
if(!this.eTop){this.div.style.display="block";
this.div.style.position="absolute";
this.eTop=document.createElement("div");
this.eTop.className=this.displayClass+"Top";
var A=this.topInUnits.length;
this.div.appendChild(this.eTop);
if((this.topOutUnits=="")||(this.topInUnits=="")){this.eTop.style.visibility="hidden"
}else{this.eTop.style.visibility="visible"
}this.eBottom=document.createElement("div");
this.eBottom.className=this.displayClass+"Bottom";
this.div.appendChild(this.eBottom);
if((this.bottomOutUnits=="")||(this.bottomInUnits=="")){this.eBottom.style.visibility="hidden"
}else{this.eBottom.style.visibility="visible"
}}this.map.events.register("moveend",this,this.update);
this.update();
return this.div
},getBarLen:function(B){var D=parseInt(Math.log(B)/Math.log(10));
var A=Math.pow(10,D);
var C=parseInt(B/A);
var E;
if(C>5){E=5
}else{if(C>2){E=2
}else{E=1
}}return E*A
},update:function(){var H=this.map.getResolution();
if(!H){return 
}var L=this.map.getUnits();
var C=OpenLayers.INCHES_PER_UNIT;
var I=this.maxWidth*H*C[L];
var A;
var D;
if(I>100000){A=this.topOutUnits;
D=this.bottomOutUnits
}else{A=this.topInUnits;
D=this.bottomInUnits
}var F=I/C[A];
var J=I/C[D];
var G=this.getBarLen(F);
var E=this.getBarLen(J);
F=G/C[L]*C[A];
J=E/C[L]*C[D];
var B=F/H;
var K=J/H;
this.eTop.style.width=Math.round(B)+"px";
this.eBottom.style.width=Math.round(K)+"px";
this.eTop.innerHTML=G+" "+A;
this.eBottom.innerHTML=E+" "+D
},CLASS_NAME:"OpenLayers.Control.ScaleLine"});OpenLayers.Control.LayerSwitcher=OpenLayers.Class(OpenLayers.Control,{activeColor:"darkblue",layerStates:null,layersDiv:null,baseLayersDiv:null,baseLayers:null,dataLbl:null,dataLayersDiv:null,dataLayers:null,minimizeDiv:null,maximizeDiv:null,ascending:true,initialize:function(A){OpenLayers.Control.prototype.initialize.apply(this,arguments);
this.layerStates=[]
},destroy:function(){OpenLayers.Event.stopObservingElement(this.div);
OpenLayers.Event.stopObservingElement(this.minimizeDiv);
OpenLayers.Event.stopObservingElement(this.maximizeDiv);
this.clearLayersArray("base");
this.clearLayersArray("data");
this.map.events.un({addlayer:this.redraw,changelayer:this.redraw,removelayer:this.redraw,changebaselayer:this.redraw,scope:this});
OpenLayers.Control.prototype.destroy.apply(this,arguments)
},setMap:function(A){OpenLayers.Control.prototype.setMap.apply(this,arguments);
this.map.events.on({addlayer:this.redraw,changelayer:this.redraw,removelayer:this.redraw,changebaselayer:this.redraw,scope:this})
},draw:function(){OpenLayers.Control.prototype.draw.apply(this);
this.loadContents();
if(!this.outsideViewport){this.minimizeControl()
}this.redraw();
return this.div
},clearLayersArray:function(D){var E=this[D+"Layers"];
if(E){for(var C=0,A=E.length;
C<A;
C++){var B=E[C];
OpenLayers.Event.stopObservingElement(B.inputElem);
OpenLayers.Event.stopObservingElement(B.labelSpan)
}}this[D+"LayersDiv"].innerHTML="";
this[D+"Layers"]=[]
},checkRedraw:function(){var E=false;
if(!this.layerStates.length||(this.map.layers.length!=this.layerStates.length)){E=true
}else{for(var C=0,A=this.layerStates.length;
C<A;
C++){var D=this.layerStates[C];
var B=this.map.layers[C];
if((D.name!=B.name)||(D.inRange!=B.inRange)||(D.id!=B.id)||(D.visibility!=B.visibility)){E=true;
break
}}}return E
},redraw:function(){if(!this.checkRedraw()){return this.div
}this.clearLayersArray("base");
this.clearLayersArray("data");
var D=false;
var L=false;
var H=this.map.layers.length;
this.layerStates=new Array(H);
for(var F=0;
F<H;
F++){var G=this.map.layers[F];
this.layerStates[F]={name:G.name,visibility:G.visibility,inRange:G.inRange,id:G.id}
}var E=this.map.layers.slice();
if(!this.ascending){E.reverse()
}for(var F=0,H=E.length;
F<H;
F++){var G=E[F];
var I=G.isBaseLayer;
if(G.displayInLayerSwitcher){if(I){L=true
}else{D=true
}var K=(I)?(G==this.map.baseLayer):G.getVisibility();
var J=document.createElement("input");
J.id=this.id+"_input_"+G.name;
J.name=(I)?"baseLayers":G.name;
J.type=(I)?"radio":"checkbox";
J.value=G.name;
J.checked=K;
J.defaultChecked=K;
if(!I&&!G.inRange){J.disabled=true
}var A={inputElem:J,layer:G,layerSwitcher:this};
OpenLayers.Event.observe(J,"mouseup",OpenLayers.Function.bindAsEventListener(this.onInputClick,A));
var B=document.createElement("span");
if(!I&&!G.inRange){B.style.color="gray"
}B.innerHTML=G.name;
B.style.verticalAlign=(I)?"bottom":"baseline";
OpenLayers.Event.observe(B,"click",OpenLayers.Function.bindAsEventListener(this.onInputClick,A));
var N=document.createElement("br");
var M=(I)?this.baseLayers:this.dataLayers;
M.push({layer:G,inputElem:J,labelSpan:B});
var C=(I)?this.baseLayersDiv:this.dataLayersDiv;
C.appendChild(J);
C.appendChild(B);
C.appendChild(N)
}}this.dataLbl.style.display=(D)?"":"none";
this.baseLbl.style.display=(L)?"":"none";
return this.div
},onInputClick:function(A){if(!this.inputElem.disabled){if(this.inputElem.type=="radio"){this.inputElem.checked=true;
this.layer.map.setBaseLayer(this.layer)
}else{this.inputElem.checked=!this.inputElem.checked;
this.layerSwitcher.updateMap()
}}OpenLayers.Event.stop(A)
},onLayerClick:function(A){this.updateMap()
},updateMap:function(){for(var B=0,A=this.baseLayers.length;
B<A;
B++){var C=this.baseLayers[B];
if(C.inputElem.checked){this.map.setBaseLayer(C.layer,false)
}}for(var B=0,A=this.dataLayers.length;
B<A;
B++){var C=this.dataLayers[B];
C.layer.setVisibility(C.inputElem.checked)
}},maximizeControl:function(A){this.div.style.width="20em";
this.div.style.height="";
this.showControls(false);
if(A!=null){OpenLayers.Event.stop(A)
}},minimizeControl:function(A){this.div.style.width="0px";
this.div.style.height="0px";
this.showControls(true);
if(A!=null){OpenLayers.Event.stop(A)
}},showControls:function(A){this.maximizeDiv.style.display=A?"":"none";
this.minimizeDiv.style.display=A?"none":"";
this.layersDiv.style.display=A?"none":""
},loadContents:function(){this.div.style.position="absolute";
this.div.style.top="25px";
this.div.style.right="0px";
this.div.style.left="";
this.div.style.fontFamily="sans-serif";
this.div.style.fontWeight="bold";
this.div.style.marginTop="3px";
this.div.style.marginLeft="3px";
this.div.style.marginBottom="3px";
this.div.style.fontSize="smaller";
this.div.style.color="white";
this.div.style.backgroundColor="transparent";
OpenLayers.Event.observe(this.div,"mouseup",OpenLayers.Function.bindAsEventListener(this.mouseUp,this));
OpenLayers.Event.observe(this.div,"click",this.ignoreEvent);
OpenLayers.Event.observe(this.div,"mousedown",OpenLayers.Function.bindAsEventListener(this.mouseDown,this));
OpenLayers.Event.observe(this.div,"dblclick",this.ignoreEvent);
this.layersDiv=document.createElement("div");
this.layersDiv.id=this.id+"_layersDiv";
this.layersDiv.style.paddingTop="5px";
this.layersDiv.style.paddingLeft="10px";
this.layersDiv.style.paddingBottom="5px";
this.layersDiv.style.paddingRight="75px";
this.layersDiv.style.backgroundColor=this.activeColor;
this.layersDiv.style.width="100%";
this.layersDiv.style.height="100%";
this.baseLbl=document.createElement("div");
this.baseLbl.innerHTML=OpenLayers.i18n("baseLayer");
this.baseLbl.style.marginTop="3px";
this.baseLbl.style.marginLeft="3px";
this.baseLbl.style.marginBottom="3px";
this.baseLayersDiv=document.createElement("div");
this.baseLayersDiv.style.paddingLeft="10px";
this.dataLbl=document.createElement("div");
this.dataLbl.innerHTML=OpenLayers.i18n("overlays");
this.dataLbl.style.marginTop="3px";
this.dataLbl.style.marginLeft="3px";
this.dataLbl.style.marginBottom="3px";
this.dataLayersDiv=document.createElement("div");
this.dataLayersDiv.style.paddingLeft="10px";
if(this.ascending){this.layersDiv.appendChild(this.baseLbl);
this.layersDiv.appendChild(this.baseLayersDiv);
this.layersDiv.appendChild(this.dataLbl);
this.layersDiv.appendChild(this.dataLayersDiv)
}else{this.layersDiv.appendChild(this.dataLbl);
this.layersDiv.appendChild(this.dataLayersDiv);
this.layersDiv.appendChild(this.baseLbl);
this.layersDiv.appendChild(this.baseLayersDiv)
}this.div.appendChild(this.layersDiv);
OpenLayers.Rico.Corner.round(this.div,{corners:"tl bl",bgColor:"transparent",color:this.activeColor,blend:false});
OpenLayers.Rico.Corner.changeOpacity(this.layersDiv,0.75);
var C=OpenLayers.Util.getImagesLocation();
var B=new OpenLayers.Size(18,18);
var A=C+"layer-switcher-maximize.png";
this.maximizeDiv=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_MaximizeDiv",null,B,A,"absolute");
this.maximizeDiv.style.top="5px";
this.maximizeDiv.style.right="0px";
this.maximizeDiv.style.left="";
this.maximizeDiv.style.display="none";
OpenLayers.Event.observe(this.maximizeDiv,"click",OpenLayers.Function.bindAsEventListener(this.maximizeControl,this));
this.div.appendChild(this.maximizeDiv);
var A=C+"layer-switcher-minimize.png";
var B=new OpenLayers.Size(18,18);
this.minimizeDiv=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_MinimizeDiv",null,B,A,"absolute");
this.minimizeDiv.style.top="5px";
this.minimizeDiv.style.right="0px";
this.minimizeDiv.style.left="";
this.minimizeDiv.style.display="none";
OpenLayers.Event.observe(this.minimizeDiv,"click",OpenLayers.Function.bindAsEventListener(this.minimizeControl,this));
this.div.appendChild(this.minimizeDiv)
},ignoreEvent:function(A){OpenLayers.Event.stop(A)
},mouseDown:function(A){this.isMouseDown=true;
this.ignoreEvent(A)
},mouseUp:function(A){if(this.isMouseDown){this.isMouseDown=false;
this.ignoreEvent(A)
}},CLASS_NAME:"OpenLayers.Control.LayerSwitcher"});OpenLayers.Control.DrawFeature=OpenLayers.Class(OpenLayers.Control,{layer:null,callbacks:null,EVENT_TYPES:["featureadded"],featureAdded:function(){},handlerOptions:null,initialize:function(B,C,A){this.EVENT_TYPES=OpenLayers.Control.DrawFeature.prototype.EVENT_TYPES.concat(OpenLayers.Control.prototype.EVENT_TYPES);
OpenLayers.Control.prototype.initialize.apply(this,[A]);
this.callbacks=OpenLayers.Util.extend({done:this.drawFeature},this.callbacks);
this.layer=B;
this.handler=new C(this,this.callbacks,this.handlerOptions)
},drawFeature:function(B){var A=new OpenLayers.Feature.Vector(B);
this.layer.addFeatures([A]);
this.featureAdded(A);
this.events.triggerEvent("featureadded",{feature:A})
},CLASS_NAME:"OpenLayers.Control.DrawFeature"});OpenLayers.Control.DragFeature=OpenLayers.Class(OpenLayers.Control,{geometryTypes:null,onStart:function(B,A){},onDrag:function(B,A){},onComplete:function(B,A){},layer:null,feature:null,dragCallbacks:{},featureCallbacks:{},lastPixel:null,initialize:function(B,A){OpenLayers.Control.prototype.initialize.apply(this,[A]);
this.layer=B;
this.handlers={drag:new OpenLayers.Handler.Drag(this,OpenLayers.Util.extend({down:this.downFeature,move:this.moveFeature,up:this.upFeature,out:this.cancel,done:this.doneDragging},this.dragCallbacks)),feature:new OpenLayers.Handler.Feature(this,this.layer,OpenLayers.Util.extend({over:this.overFeature,out:this.outFeature},this.featureCallbacks),{geometryTypes:this.geometryTypes})}
},destroy:function(){this.layer=null;
OpenLayers.Control.prototype.destroy.apply(this,[])
},activate:function(){return(this.handlers.feature.activate()&&OpenLayers.Control.prototype.activate.apply(this,arguments))
},deactivate:function(){this.handlers.drag.deactivate();
this.handlers.feature.deactivate();
this.feature=null;
this.dragging=false;
this.lastPixel=null;
return OpenLayers.Control.prototype.deactivate.apply(this,arguments)
},overFeature:function(A){if(!this.handlers.drag.dragging){this.feature=A;
this.handlers.drag.activate();
this.over=true;
this.map.div.style.cursor="pointer"
}else{if(this.feature.id==A.id){this.over=true
}else{this.over=false
}}},downFeature:function(A){this.lastPixel=A;
this.onStart(this.feature,A)
},moveFeature:function(A){var B=this.map.getResolution();
this.feature.geometry.move(B*(A.x-this.lastPixel.x),B*(this.lastPixel.y-A.y));
this.layer.drawFeature(this.feature);
this.lastPixel=A;
this.onDrag(this.feature,A)
},upFeature:function(A){if(!this.over){this.handlers.drag.deactivate();
this.feature=null;
this.map.div.style.cursor="default"
}else{this.map.div.style.cursor="pointer"
}},doneDragging:function(A){this.onComplete(this.feature,A)
},outFeature:function(A){if(!this.handlers.drag.dragging){this.over=false;
this.handlers.drag.deactivate();
this.map.div.style.cursor="default";
this.feature=null
}else{if(this.feature.id==A.id){this.over=false
}}},cancel:function(){this.handlers.drag.deactivate();
this.over=false
},setMap:function(A){this.handlers.drag.setMap(A);
this.handlers.feature.setMap(A);
OpenLayers.Control.prototype.setMap.apply(this,arguments)
},CLASS_NAME:"OpenLayers.Control.DragFeature"});OpenLayers.Control.ModifyFeature=OpenLayers.Class(OpenLayers.Control,{geometryTypes:null,clickout:true,toggle:true,layer:null,feature:null,vertices:null,virtualVertices:null,selectControl:null,dragControl:null,handlers:null,deleteCodes:null,virtualStyle:null,mode:null,radiusHandle:null,dragHandle:null,onModificationStart:function(){},onModification:function(){},onModificationEnd:function(){},initialize:function(D,C){this.layer=D;
this.vertices=[];
this.virtualVertices=[];
this.virtualStyle=OpenLayers.Util.extend({},this.layer.style||this.layer.styleMap.createSymbolizer());
this.virtualStyle.fillOpacity=0.3;
this.virtualStyle.strokeOpacity=0.3;
this.realStyle=OpenLayers.Util.extend({},this.layer.style||this.layer.styleMap.createSymbolizer());
this.deleteCodes=[46,68];
this.mode=OpenLayers.Control.ModifyFeature.RESHAPE;
OpenLayers.Control.prototype.initialize.apply(this,[C]);
if(!(this.deleteCodes instanceof Array)){this.deleteCodes=[this.deleteCodes]
}var F=this;
var A={geometryTypes:this.geometryTypes,clickout:this.clickout,toggle:this.toggle};
this.selectControl=new OpenLayers.Control.SelectFeature(D,A);
this.layer.events.on({beforefeatureselected:this.beforeSelectFeature,featureselected:this.selectFeature,featureunselected:this.unselectFeature,scope:this});
var B={geometryTypes:["OpenLayers.Geometry.Point"],snappingOptions:this.snappingOptions,onStart:function(H,G){F.dragStart.apply(F,[H,G])
},onDrag:function(G){F.dragVertex.apply(F,[G])
},onComplete:function(G){F.dragComplete.apply(F,[G])
}};
this.dragControl=new OpenLayers.Control.DragFeature(D,B);
var E={keydown:this.handleKeypress};
this.handlers={keyboard:new OpenLayers.Handler.Keyboard(this,E)}
},destroy:function(){this.layer.events.un({beforefeatureselected:this.beforeSelectFeature,featureselected:this.selectFeature,featureunselected:this.unselectFeature,scope:this});
this.layer=null;
this.selectControl.destroy();
this.dragControl.destroy();
OpenLayers.Control.prototype.destroy.apply(this,[])
},activate:function(){return(this.selectControl.activate()&&this.handlers.keyboard.activate()&&OpenLayers.Control.prototype.activate.apply(this,arguments))
},deactivate:function(){var A=false;
if(OpenLayers.Control.prototype.deactivate.apply(this,arguments)){this.layer.removeFeatures(this.vertices,{silent:true});
this.layer.removeFeatures(this.virtualVertices,{silent:true});
this.vertices=[];
this.dragControl.deactivate();
if(this.feature&&this.feature.geometry){this.selectControl.unselect.apply(this.selectControl,[this.feature])
}this.selectControl.deactivate();
this.handlers.keyboard.deactivate();
A=true
}return A
},beforeSelectFeature:function(A){return this.layer.events.triggerEvent("beforefeaturemodified",{feature:A.feature})
},selectFeature:function(A){this.feature=A.feature;
this.resetVertices();
this.dragControl.activate();
this.onModificationStart(this.feature)
},unselectFeature:function(A){this.layer.removeFeatures(this.vertices,{silent:true});
this.vertices=[];
this.layer.destroyFeatures(this.virtualVertices,{silent:true});
this.virtualVertices=[];
if(this.dragHandle){this.layer.destroyFeatures([this.dragHandle],{silent:true});
delete this.dragHandle
}if(this.radiusHandle){this.layer.destroyFeatures([this.radiusHandle],{silent:true});
delete this.radiusHandle
}this.feature=null;
this.dragControl.deactivate();
this.onModificationEnd(A.feature);
this.layer.events.triggerEvent("afterfeaturemodified",{feature:A.feature})
},dragStart:function(B,A){if(B!=this.feature&&!B.geometry.parent&&B!=this.dragHandle&&B!=this.radiusHandle){if(this.feature){this.selectControl.clickFeature.apply(this.selectControl,[this.feature])
}if(this.geometryTypes==null||OpenLayers.Util.indexOf(this.geometryTypes,B.geometry.CLASS_NAME)!=-1){this.selectControl.clickFeature.apply(this.selectControl,[B]);
this.dragControl.overFeature.apply(this.dragControl,[B]);
this.dragControl.lastPixel=A;
this.dragControl.handlers.drag.started=true;
this.dragControl.handlers.drag.start=A;
this.dragControl.handlers.drag.last=A
}}},dragVertex:function(A){if(this.feature.geometry.CLASS_NAME=="OpenLayers.Geometry.Point"){if(this.feature!=A){this.feature=A
}}else{if(A._index){A.geometry.parent.addComponent(A.geometry,A._index);
delete A._index;
OpenLayers.Util.removeItem(this.virtualVertices,A);
this.vertices.push(A)
}else{if(A==this.dragHandle){this.layer.removeFeatures(this.vertices,{silent:true});
this.vertices=[];
if(this.radiusHandle){this.layer.destroyFeatures([this.radiusHandle],{silent:true});
this.radiusHandle=null
}}}if(this.virtualVertices.length>0){this.layer.destroyFeatures(this.virtualVertices,{silent:true});
this.virtualVertices=[]
}this.layer.drawFeature(this.feature,this.selectControl.renderIntent)
}this.layer.drawFeature(A)
},dragComplete:function(A){this.resetVertices();
this.onModification(this.feature);
this.layer.events.triggerEvent("featuremodified",{feature:this.feature})
},resetVertices:function(){if(this.dragControl.feature){this.dragControl.outFeature(this.dragControl.feature)
}if(this.vertices.length>0){this.layer.removeFeatures(this.vertices,{silent:true});
this.vertices=[]
}if(this.virtualVertices.length>0){this.layer.removeFeatures(this.virtualVertices,{silent:true});
this.virtualVertices=[]
}if(this.dragHandle){this.layer.destroyFeatures([this.dragHandle],{silent:true});
this.dragHandle=null
}if(this.radiusHandle){this.layer.destroyFeatures([this.radiusHandle],{silent:true});
this.radiusHandle=null
}if(this.feature&&this.feature.geometry.CLASS_NAME!="OpenLayers.Geometry.Point"){if((this.mode&OpenLayers.Control.ModifyFeature.DRAG)){this.collectDragHandle()
}if((this.mode&(OpenLayers.Control.ModifyFeature.ROTATE|OpenLayers.Control.ModifyFeature.RESIZE))){this.collectRadiusHandle()
}if((this.mode&OpenLayers.Control.ModifyFeature.RESHAPE)){this.collectVertices()
}}},handleKeypress:function(A){var B=A.keyCode;
if(this.feature&&OpenLayers.Util.indexOf(this.deleteCodes,B)!=-1){var C=this.dragControl.feature;
if(C&&OpenLayers.Util.indexOf(this.vertices,C)!=-1&&!this.dragControl.handlers.drag.dragging&&C.geometry.parent){C.geometry.parent.removeComponent(C.geometry);
this.layer.drawFeature(this.feature,this.selectControl.renderIntent);
this.resetVertices();
this.onModification(this.feature);
this.layer.events.triggerEvent("featuremodified",{feature:this.feature})
}}},collectVertices:function(){this.vertices=[];
this.virtualVertices=[];
var A=this;
function B(H){var D,E,I,F;
if(H.CLASS_NAME=="OpenLayers.Geometry.Point"){E=new OpenLayers.Feature.Vector(H);
A.vertices.push(E)
}else{var C=H.components.length;
if(H.CLASS_NAME=="OpenLayers.Geometry.LinearRing"){C-=1
}for(D=0;
D<C;
++D){I=H.components[D];
if(I.CLASS_NAME=="OpenLayers.Geometry.Point"){E=new OpenLayers.Feature.Vector(I,null,A.realStyle);
A.vertices.push(E)
}else{B(I)
}}if(H.CLASS_NAME!="OpenLayers.Geometry.MultiPoint"){for(D=0,F=H.components.length;
D<F-1;
++D){var L=H.components[D];
var M=H.components[D+1];
if(L.CLASS_NAME=="OpenLayers.Geometry.Point"&&M.CLASS_NAME=="OpenLayers.Geometry.Point"){var J=(L.x+M.x)/2;
var G=(L.y+M.y)/2;
var K=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(J,G),null,A.virtualStyle);
K.geometry.parent=H;
K._index=D+1;
A.virtualVertices.push(K)
}}}}}B.call(this,this.feature.geometry);
this.layer.addFeatures(this.virtualVertices,{silent:true});
this.layer.addFeatures(this.vertices,{silent:true})
},collectDragHandle:function(){var D=this.feature.geometry;
var A=D.getBounds().getCenterLonLat();
var C=new OpenLayers.Geometry.Point(A.lon,A.lat);
var B=new OpenLayers.Feature.Vector(C);
C.move=function(E,F){OpenLayers.Geometry.Point.prototype.move.call(this,E,F);
D.move(E,F)
};
this.dragHandle=B;
this.layer.addFeatures([this.dragHandle],{silent:true})
},collectRadiusHandle:function(){var H=this.feature.geometry;
var G=H.getBounds();
var B=G.getCenterLonLat();
var F=new OpenLayers.Geometry.Point(B.lon,B.lat);
var C=new OpenLayers.Geometry.Point(G.right,G.bottom);
var A=new OpenLayers.Feature.Vector(C);
var E=(this.mode&OpenLayers.Control.ModifyFeature.RESIZE);
var D=(this.mode&OpenLayers.Control.ModifyFeature.ROTATE);
C.move=function(Q,P){OpenLayers.Geometry.Point.prototype.move.call(this,Q,P);
var R=this.x-F.x;
var N=this.y-F.y;
var S=R-Q;
var O=N-P;
if(D){var J=Math.atan2(O,S);
var I=Math.atan2(N,R);
var L=I-J;
L*=180/Math.PI;
H.rotate(L,F)
}if(E){var M=Math.sqrt((S*S)+(O*O));
var K=Math.sqrt((R*R)+(N*N));
H.resize(K/M,F)
}};
this.radiusHandle=A;
this.layer.addFeatures([this.radiusHandle],{silent:true})
},setMap:function(A){this.selectControl.setMap(A);
this.dragControl.setMap(A);
OpenLayers.Control.prototype.setMap.apply(this,arguments)
},CLASS_NAME:"OpenLayers.Control.ModifyFeature"});
OpenLayers.Control.ModifyFeature.RESHAPE=1;
OpenLayers.Control.ModifyFeature.RESIZE=2;
OpenLayers.Control.ModifyFeature.ROTATE=4;
OpenLayers.Control.ModifyFeature.DRAG=8;OpenLayers.Control.Panel=OpenLayers.Class(OpenLayers.Control,{controls:null,defaultControl:null,initialize:function(A){OpenLayers.Control.prototype.initialize.apply(this,[A]);
this.controls=[]
},destroy:function(){OpenLayers.Control.prototype.destroy.apply(this,arguments);
for(var A=this.controls.length-1;
A>=0;
A--){if(this.controls[A].events){this.controls[A].events.un({activate:this.redraw,deactivate:this.redraw,scope:this})
}OpenLayers.Event.stopObservingElement(this.controls[A].panel_div);
this.controls[A].panel_div=null
}},activate:function(){if(OpenLayers.Control.prototype.activate.apply(this,arguments)){for(var B=0,A=this.controls.length;
B<A;
B++){if(this.controls[B]==this.defaultControl){this.controls[B].activate()
}}this.redraw();
return true
}else{return false
}},deactivate:function(){if(OpenLayers.Control.prototype.deactivate.apply(this,arguments)){for(var B=0,A=this.controls.length;
B<A;
B++){this.controls[B].deactivate()
}return true
}else{return false
}},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);
for(var B=0,A=this.controls.length;
B<A;
B++){this.map.addControl(this.controls[B]);
this.controls[B].deactivate();
this.controls[B].events.on({activate:this.redraw,deactivate:this.redraw,scope:this})
}this.activate();
return this.div
},redraw:function(){this.div.innerHTML="";
if(this.active){for(var C=0,A=this.controls.length;
C<A;
C++){var B=this.controls[C].panel_div;
if(this.controls[C].active){B.className=this.controls[C].displayClass+"ItemActive"
}else{B.className=this.controls[C].displayClass+"ItemInactive"
}this.div.appendChild(B)
}}},activateControl:function(C){if(!this.active){return false
}if(C.type==OpenLayers.Control.TYPE_BUTTON){C.trigger();
this.redraw();
return 
}if(C.type==OpenLayers.Control.TYPE_TOGGLE){if(C.active){C.deactivate()
}else{C.activate()
}this.redraw();
return 
}for(var B=0,A=this.controls.length;
B<A;
B++){if(this.controls[B]!=C){if(this.controls[B].type!=OpenLayers.Control.TYPE_TOGGLE){this.controls[B].deactivate()
}}}C.activate()
},addControls:function(B){if(!(B instanceof Array)){B=[B]
}this.controls=this.controls.concat(B);
for(var D=0,A=B.length;
D<A;
D++){var C=document.createElement("div");
var E=document.createTextNode(" ");
B[D].panel_div=C;
if(B[D].title!=""){B[D].panel_div.title=B[D].title
}OpenLayers.Event.observe(B[D].panel_div,"click",OpenLayers.Function.bind(this.onClick,this,B[D]));
OpenLayers.Event.observe(B[D].panel_div,"mousedown",OpenLayers.Function.bindAsEventListener(OpenLayers.Event.stop))
}if(this.map){for(var D=0,A=B.length;
D<A;
D++){this.map.addControl(B[D]);
B[D].deactivate();
B[D].events.on({activate:this.redraw,deactivate:this.redraw,scope:this})
}this.redraw()
}},onClick:function(B,A){OpenLayers.Event.stop(A?A:window.event);
this.activateControl(B)
},getControlsBy:function(C,A){var D=(typeof A.test=="function");
var B=OpenLayers.Array.filter(this.controls,function(E){return E[C]==A||(D&&A.test(E[C]))
});
return B
},getControlsByName:function(A){return this.getControlsBy("name",A)
},getControlsByClass:function(A){return this.getControlsBy("CLASS_NAME",A)
},CLASS_NAME:"OpenLayers.Control.Panel"});OpenLayers.Control.SelectFeature=OpenLayers.Class(OpenLayers.Control,{multipleKey:null,toggleKey:null,multiple:false,clickout:true,toggle:false,hover:false,box:false,onSelect:function(){},onUnselect:function(){},geometryTypes:null,layer:null,callbacks:null,selectStyle:null,renderIntent:"select",handlers:null,initialize:function(B,A){OpenLayers.Control.prototype.initialize.apply(this,[A]);
this.layer=B;
var C={click:this.clickFeature,clickout:this.clickoutFeature};
if(this.hover){C.over=this.overFeature;
C.out=this.outFeature
}this.callbacks=OpenLayers.Util.extend(C,this.callbacks);
this.handlers={feature:new OpenLayers.Handler.Feature(this,B,this.callbacks,{geometryTypes:this.geometryTypes})};
if(this.box){this.handlers.box=new OpenLayers.Handler.Box(this,{done:this.selectBox},{boxDivClassName:"olHandlerBoxSelectFeature"})
}},activate:function(){if(!this.active){this.handlers.feature.activate();
if(this.box&&this.handlers.box){this.handlers.box.activate()
}}return OpenLayers.Control.prototype.activate.apply(this,arguments)
},deactivate:function(){if(this.active){this.handlers.feature.deactivate();
if(this.handlers.box){this.handlers.box.deactivate()
}}return OpenLayers.Control.prototype.deactivate.apply(this,arguments)
},unselectAll:function(A){var C;
for(var B=this.layer.selectedFeatures.length-1;
B>=0;
--B){C=this.layer.selectedFeatures[B];
if(!A||A.except!=C){this.unselect(C)
}}},clickFeature:function(A){if(!this.hover){var B=(OpenLayers.Util.indexOf(this.layer.selectedFeatures,A)>-1);
if(B){if(this.toggleSelect()){this.unselect(A)
}else{if(!this.multipleSelect()){this.unselectAll({except:A})
}}}else{if(!this.multipleSelect()){this.unselectAll({except:A})
}this.select(A)
}}},multipleSelect:function(){return this.multiple||this.handlers.feature.evt[this.multipleKey]
},toggleSelect:function(){return this.toggle||this.handlers.feature.evt[this.toggleKey]
},clickoutFeature:function(A){if(!this.hover&&this.clickout){this.unselectAll()
}},overFeature:function(A){if(this.hover&&(OpenLayers.Util.indexOf(this.layer.selectedFeatures,A)==-1)){this.select(A)
}},outFeature:function(A){if(this.hover){this.unselect(A)
}},select:function(C){var A=this.layer.events.triggerEvent("beforefeatureselected",{feature:C});
if(A!==false){this.layer.selectedFeatures.push(C);
var B=this.selectStyle||this.renderIntent;
this.layer.drawFeature(C,B);
this.layer.events.triggerEvent("featureselected",{feature:C});
this.onSelect(C)
}},unselect:function(A){this.layer.drawFeature(A,"default");
OpenLayers.Util.removeItem(this.layer.selectedFeatures,A);
this.layer.events.triggerEvent("featureunselected",{feature:A});
this.onUnselect(A)
},selectBox:function(B){if(B instanceof OpenLayers.Bounds){var G=this.map.getLonLatFromPixel(new OpenLayers.Pixel(B.left,B.bottom));
var C=this.map.getLonLatFromPixel(new OpenLayers.Pixel(B.right,B.top));
var F=new OpenLayers.Bounds(G.lon,G.lat,C.lon,C.lat);
if(!this.multipleSelect()){this.unselectAll()
}var H=this.multiple;
this.multiple=true;
for(var E=0,A=this.layer.features.length;
E<A;
++E){var D=this.layer.features[E];
if(this.geometryTypes==null||OpenLayers.Util.indexOf(this.geometryTypes,D.geometry.CLASS_NAME)>-1){if(F.toGeometry().intersects(D.geometry)){if(OpenLayers.Util.indexOf(this.layer.selectedFeatures,D)==-1){this.select(D)
}}}}this.multiple=H
}},setMap:function(A){this.handlers.feature.setMap(A);
if(this.box){this.handlers.box.setMap(A)
}OpenLayers.Control.prototype.setMap.apply(this,arguments)
},CLASS_NAME:"OpenLayers.Control.SelectFeature"});OpenLayers.Control.Measure=OpenLayers.Class(OpenLayers.Control,{EVENT_TYPES:["measure","measurepartial"],handlerOptions:null,callbacks:null,displaySystem:"metric",displaySystemUnits:{geographic:["dd"],english:["mi","ft","in"],metric:["km","m"]},initialize:function(B,A){this.EVENT_TYPES=OpenLayers.Control.Measure.prototype.EVENT_TYPES.concat(OpenLayers.Control.prototype.EVENT_TYPES);
OpenLayers.Control.prototype.initialize.apply(this,[A]);
this.callbacks=OpenLayers.Util.extend({done:this.measureComplete,point:this.measurePartial},this.callbacks);
this.handler=new B(this,this.callbacks,this.handlerOptions)
},updateHandler:function(B,A){var C=this.active;
if(C){this.deactivate()
}this.handler=new B(this,this.callbacks,A);
if(C){this.activate()
}},measureComplete:function(A){this.measure(A,"measure")
},measurePartial:function(A,B){this.measure(B,"measurepartial")
},measure:function(D,B){var C,A;
if(D.CLASS_NAME.indexOf("LineString")>-1){C=this.getBestLength(D);
A=1
}else{C=this.getBestArea(D);
A=2
}this.events.triggerEvent(B,{measure:C[0],units:C[1],order:A,geometry:D})
},getBestArea:function(F){var B=this.displaySystemUnits[this.displaySystem];
var E,D;
for(var C=0,A=B.length;
C<A;
++C){E=B[C];
D=this.getArea(F,E);
if(D>1){break
}}return[D,E]
},getArea:function(E,A){var B=E.getArea();
var D=OpenLayers.INCHES_PER_UNIT[A];
if(D){var C=OpenLayers.INCHES_PER_UNIT[this.map.getUnits()];
B*=Math.pow((C/D),2)
}return B
},getBestLength:function(F){var B=this.displaySystemUnits[this.displaySystem];
var E,D;
for(var C=0,A=B.length;
C<A;
++C){E=B[C];
D=this.getLength(F,E);
if(D>1){break
}}return[D,E]
},getLength:function(E,A){var B=E.getLength();
var D=OpenLayers.INCHES_PER_UNIT[A];
if(D){var C=OpenLayers.INCHES_PER_UNIT[this.map.getUnits()];
B*=(C/D)
}return B
},CLASS_NAME:"OpenLayers.Control.Measure"});OpenLayers.Geometry=OpenLayers.Class({id:null,parent:null,bounds:null,initialize:function(){this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")
},destroy:function(){this.id=null;
this.bounds=null
},clone:function(){return new OpenLayers.Geometry()
},setBounds:function(A){if(A){this.bounds=A.clone()
}},clearBounds:function(){this.bounds=null;
if(this.parent){this.parent.clearBounds()
}},extendBounds:function(B){var A=this.getBounds();
if(!A){this.setBounds(B)
}else{this.bounds.extend(B)
}},getBounds:function(){if(this.bounds==null){this.calculateBounds()
}return this.bounds
},calculateBounds:function(){},atPoint:function(E,H,F){var C=false;
var D=this.getBounds();
if((D!=null)&&(E!=null)){var B=(H!=null)?H:0;
var A=(F!=null)?F:0;
var G=new OpenLayers.Bounds(this.bounds.left-B,this.bounds.bottom-A,this.bounds.right+B,this.bounds.top+A);
C=G.containsLonLat(E)
}return C
},getLength:function(){return 0
},getArea:function(){return 0
},toString:function(){return OpenLayers.Format.WKT?OpenLayers.Format.WKT.prototype.write(new OpenLayers.Feature.Vector(this)):new OpenLayers.Feature.Vector(this)
},CLASS_NAME:"OpenLayers.Geometry"});
OpenLayers.Geometry.segmentsIntersect=function(Q,P,M){var A=false;
var N=Q.x1-P.x1;
var B=Q.y1-P.y1;
var O=Q.x2-Q.x1;
var C=Q.y2-Q.y1;
var L=P.y2-P.y1;
var F=P.x2-P.x1;
var I=(L*O)-(F*C);
var H=(F*B)-(L*N);
var G=(O*B)-(C*N);
if(I==0){if(H==0&&G==0){A=true
}}else{var E=H/I;
var D=G/I;
if(E>=0&&E<=1&&D>=0&&D<=1){if(!M){A=true
}else{var K=Q.x1+(E*O);
var J=Q.y1+(E*C);
A=new OpenLayers.Geometry.Point(K,J)
}}}return A
};OpenLayers.Geometry.Rectangle=OpenLayers.Class(OpenLayers.Geometry,{x:null,y:null,width:null,height:null,initialize:function(B,D,C,A){OpenLayers.Geometry.prototype.initialize.apply(this,arguments);
this.x=B;
this.y=D;
this.width=C;
this.height=A
},calculateBounds:function(){this.bounds=new OpenLayers.Bounds(this.x,this.y,this.x+this.width,this.y+this.height)
},getLength:function(){var A=(2*this.width)+(2*this.height);
return A
},getArea:function(){var A=this.width*this.height;
return A
},CLASS_NAME:"OpenLayers.Geometry.Rectangle"});OpenLayers.Geometry.Collection=OpenLayers.Class(OpenLayers.Geometry,{components:null,componentTypes:null,initialize:function(A){OpenLayers.Geometry.prototype.initialize.apply(this,arguments);
this.components=[];
if(A!=null){this.addComponents(A)
}},destroy:function(){this.components.length=0;
this.components=null
},clone:function(){var geometry=eval("new "+this.CLASS_NAME+"()");
for(var i=0,len=this.components.length;
i<len;
i++){geometry.addComponent(this.components[i].clone())
}OpenLayers.Util.applyDefaults(geometry,this);
return geometry
},getComponentsString:function(){var B=[];
for(var C=0,A=this.components.length;
C<A;
C++){B.push(this.components[C].toShortString())
}return B.join(",")
},calculateBounds:function(){this.bounds=null;
if(this.components&&this.components.length>0){this.setBounds(this.components[0].getBounds());
for(var B=1,A=this.components.length;
B<A;
B++){this.extendBounds(this.components[B].getBounds())
}}},addComponents:function(C){if(!(C instanceof Array)){C=[C]
}for(var B=0,A=C.length;
B<A;
B++){this.addComponent(C[B])
}},addComponent:function(B,A){var D=false;
if(B){if(this.componentTypes==null||(OpenLayers.Util.indexOf(this.componentTypes,B.CLASS_NAME)>-1)){if(A!=null&&(A<this.components.length)){var E=this.components.slice(0,A);
var C=this.components.slice(A,this.components.length);
E.push(B);
this.components=E.concat(C)
}else{this.components.push(B)
}B.parent=this;
this.clearBounds();
D=true
}}return D
},removeComponents:function(B){if(!(B instanceof Array)){B=[B]
}for(var A=B.length-1;
A>=0;
--A){this.removeComponent(B[A])
}},removeComponent:function(A){OpenLayers.Util.removeItem(this.components,A);
this.clearBounds()
},getLength:function(){var C=0;
for(var B=0,A=this.components.length;
B<A;
B++){C+=this.components[B].getLength()
}return C
},getArea:function(){var C=0;
for(var B=0,A=this.components.length;
B<A;
B++){C+=this.components[B].getArea()
}return C
},move:function(B,D){for(var C=0,A=this.components.length;
C<A;
C++){this.components[C].move(B,D)
}},rotate:function(D,B){for(var C=0,A=this.components.length;
C<A;
++C){this.components[C].rotate(D,B)
}},resize:function(D,A,C){for(var B=0;
B<this.components.length;
++B){this.components[B].resize(D,A,C)
}},equals:function(D){var B=true;
if(!D||!D.CLASS_NAME||(this.CLASS_NAME!=D.CLASS_NAME)){B=false
}else{if(!(D.components instanceof Array)||(D.components.length!=this.components.length)){B=false
}else{for(var C=0,A=this.components.length;
C<A;
++C){if(!this.components[C].equals(D.components[C])){B=false;
break
}}}}return B
},transform:function(E,C){if(E&&C){for(var D=0,A=this.components.length;
D<A;
D++){var B=this.components[D];
B.transform(E,C)
}this.bounds=null
}return this
},intersects:function(D){var B=false;
for(var C=0,A=this.components.length;
C<A;
++C){B=D.intersects(this.components[C]);
if(B){break
}}return B
},CLASS_NAME:"OpenLayers.Geometry.Collection"});OpenLayers.Geometry.Point=OpenLayers.Class(OpenLayers.Geometry,{x:null,y:null,initialize:function(A,B){OpenLayers.Geometry.prototype.initialize.apply(this,arguments);
this.x=parseFloat(A);
this.y=parseFloat(B)
},clone:function(A){if(A==null){A=new OpenLayers.Geometry.Point(this.x,this.y)
}OpenLayers.Util.applyDefaults(A,this);
return A
},calculateBounds:function(){this.bounds=new OpenLayers.Bounds(this.x,this.y,this.x,this.y)
},distanceTo:function(B){var D=0;
if((this.x!=null)&&(this.y!=null)&&(B!=null)&&(B.x!=null)&&(B.y!=null)){var C=Math.pow(this.x-B.x,2);
var A=Math.pow(this.y-B.y,2);
D=Math.sqrt(C+A)
}return D
},equals:function(A){var B=false;
if(A!=null){B=((this.x==A.x&&this.y==A.y)||(isNaN(this.x)&&isNaN(this.y)&&isNaN(A.x)&&isNaN(A.y)))
}return B
},toShortString:function(){return(this.x+", "+this.y)
},move:function(A,B){this.x=this.x+A;
this.y=this.y+B;
this.clearBounds()
},rotate:function(D,B){D*=Math.PI/180;
var A=this.distanceTo(B);
var C=D+Math.atan2(this.y-B.y,this.x-B.x);
this.x=B.x+(A*Math.cos(C));
this.y=B.y+(A*Math.sin(C));
this.clearBounds()
},resize:function(C,A,B){B=(B==undefined)?1:B;
this.x=A.x+(C*B*(this.x-A.x));
this.y=A.y+(C*(this.y-A.y));
this.clearBounds()
},intersects:function(B){var A=false;
if(B.CLASS_NAME=="OpenLayers.Geometry.Point"){A=this.equals(B)
}else{A=B.intersects(this)
}return A
},transform:function(B,A){if((B&&A)){OpenLayers.Projection.transform(this,B,A);
this.bounds=null
}return this
},CLASS_NAME:"OpenLayers.Geometry.Point"});OpenLayers.Geometry.MultiPoint=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.Point"],initialize:function(A){OpenLayers.Geometry.Collection.prototype.initialize.apply(this,arguments)
},addPoint:function(A,B){this.addComponent(A,B)
},removePoint:function(A){this.removeComponent(A)
},CLASS_NAME:"OpenLayers.Geometry.MultiPoint"});OpenLayers.Geometry.Curve=OpenLayers.Class(OpenLayers.Geometry.MultiPoint,{componentTypes:["OpenLayers.Geometry.Point"],initialize:function(A){OpenLayers.Geometry.MultiPoint.prototype.initialize.apply(this,arguments)
},getLength:function(){var C=0;
if(this.components&&(this.components.length>1)){for(var B=1,A=this.components.length;
B<A;
B++){C+=this.components[B-1].distanceTo(this.components[B])
}}return C
},CLASS_NAME:"OpenLayers.Geometry.Curve"});OpenLayers.Geometry.LineString=OpenLayers.Class(OpenLayers.Geometry.Curve,{initialize:function(A){OpenLayers.Geometry.Curve.prototype.initialize.apply(this,arguments)
},removeComponent:function(A){if(this.components&&(this.components.length>2)){OpenLayers.Geometry.Collection.prototype.removeComponent.apply(this,arguments)
}},intersects:function(K){var C=false;
var J=K.CLASS_NAME;
if(J=="OpenLayers.Geometry.LineString"||J=="OpenLayers.Geometry.LinearRing"||J=="OpenLayers.Geometry.Point"){var N=this.getSortedSegments();
var L;
if(J=="OpenLayers.Geometry.Point"){L=[{x1:K.x,y1:K.y,x2:K.x,y2:K.y}]
}else{L=K.getSortedSegments()
}var Q,G,E,A,P,O,D,B;
outer:for(var H=0,I=N.length;
H<I;
++H){Q=N[H];
G=Q.x1;
E=Q.x2;
A=Q.y1;
P=Q.y2;
inner:for(var F=0,M=L.length;
F<M;
++F){O=L[F];
if(O.x1>E){break
}if(O.x2<G){continue
}D=O.y1;
B=O.y2;
if(Math.min(D,B)>Math.max(A,P)){continue
}if(Math.max(D,B)<Math.min(A,P)){continue
}if(OpenLayers.Geometry.segmentsIntersect(Q,O)){C=true;
break outer
}}}}else{C=K.intersects(this)
}return C
},getSortedSegments:function(){var A=this.components.length-1;
var B=new Array(A);
for(var C=0;
C<A;
++C){point1=this.components[C];
point2=this.components[C+1];
if(point1.x<point2.x){B[C]={x1:point1.x,y1:point1.y,x2:point2.x,y2:point2.y}
}else{B[C]={x1:point2.x,y1:point2.y,x2:point1.x,y2:point1.y}
}}function D(F,E){return F.x1-E.x1
}return B.sort(D)
},CLASS_NAME:"OpenLayers.Geometry.LineString"});OpenLayers.Geometry.LinearRing=OpenLayers.Class(OpenLayers.Geometry.LineString,{componentTypes:["OpenLayers.Geometry.Point"],initialize:function(A){OpenLayers.Geometry.LineString.prototype.initialize.apply(this,arguments)
},addComponent:function(A,B){var C=false;
var D=this.components.pop();
if(B!=null||!A.equals(D)){C=OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,arguments)
}var E=this.components[0];
OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,[E]);
return C
},removeComponent:function(A){if(this.components.length>4){this.components.pop();
OpenLayers.Geometry.Collection.prototype.removeComponent.apply(this,arguments);
var B=this.components[0];
OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,[B])
}},move:function(B,D){for(var C=0,A=this.components.length;
C<A-1;
C++){this.components[C].move(B,D)
}},rotate:function(D,B){for(var C=0,A=this.components.length;
C<A-1;
++C){this.components[C].rotate(D,B)
}},resize:function(E,B,D){for(var C=0,A=this.components.length;
C<A-1;
++C){this.components[C].resize(E,B,D)
}},transform:function(E,C){if(E&&C){for(var D=0,A=this.components.length;
D<A-1;
D++){var B=this.components[D];
B.transform(E,C)
}this.bounds=null
}return this
},getArea:function(){var E=0;
if(this.components&&(this.components.length>2)){var D=0;
for(var C=0,B=this.components.length;
C<B-1;
C++){var A=this.components[C];
var F=this.components[C+1];
D+=(A.x+F.x)*(F.y-A.y)
}E=-D/2
}return E
},containsPoint:function(L){var R=OpenLayers.Number.limitSigDigs;
var K=14;
var J=R(L.x,K);
var I=R(L.y,K);
function Q(W,T,V,S,U){return(((T-S)*W)+((S*V)-(T*U)))/(V-U)
}var A=this.components.length-1;
var G,F,P,D,N,B,E,C;
var H=0;
for(var M=0;
M<A;
++M){G=this.components[M];
P=R(G.x,K);
D=R(G.y,K);
F=this.components[M+1];
N=R(F.x,K);
B=R(F.y,K);
if(D==B){if(I==D){if(P<=N&&(J>=P&&J<=N)||P>=N&&(J<=P&&J>=N)){H=-1;
break
}}continue
}E=R(Q(I,P,D,N,B),K);
if(E==J){if(D<B&&(I>=D&&I<=B)||D>B&&(I<=D&&I>=B)){H=-1;
break
}}if(E<=J){continue
}if(P!=N&&(E<Math.min(P,N)||E>Math.max(P,N))){continue
}if(D<B&&(I>=D&&I<B)||D>B&&(I<D&&I>=B)){++H
}}var O=(H==-1)?1:!!(H&1);
return O
},intersects:function(D){var B=false;
if(D.CLASS_NAME=="OpenLayers.Geometry.Point"){B=this.containsPoint(D)
}else{if(D.CLASS_NAME=="OpenLayers.Geometry.LineString"){B=D.intersects(this)
}else{if(D.CLASS_NAME=="OpenLayers.Geometry.LinearRing"){B=OpenLayers.Geometry.LineString.prototype.intersects.apply(this,[D])
}else{for(var C=0,A=D.components.length;
C<A;
++C){B=D.components[C].intersects(this);
if(B){break
}}}}}return B
},CLASS_NAME:"OpenLayers.Geometry.LinearRing"});OpenLayers.Geometry.Polygon=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.LinearRing"],initialize:function(A){OpenLayers.Geometry.Collection.prototype.initialize.apply(this,arguments)
},getArea:function(){var C=0;
if(this.components&&(this.components.length>0)){C+=Math.abs(this.components[0].getArea());
for(var B=1,A=this.components.length;
B<A;
B++){C-=Math.abs(this.components[B].getArea())
}}return C
},containsPoint:function(A){var E=this.components.length;
var C=false;
if(E>0){C=this.components[0].containsPoint(A);
if(C!==1){if(C&&E>1){var D;
for(var B=1;
B<E;
++B){D=this.components[B].containsPoint(A);
if(D){if(D===1){C=1
}else{C=false
}break
}}}}}return C
},intersects:function(E){var B=false;
var D,A;
if(E.CLASS_NAME=="OpenLayers.Geometry.Point"){B=this.containsPoint(E)
}else{if(E.CLASS_NAME=="OpenLayers.Geometry.LineString"||E.CLASS_NAME=="OpenLayers.Geometry.LinearRing"){for(D=0,A=this.components.length;
D<A;
++D){B=E.intersects(this.components[D]);
if(B){break
}}if(!B){for(D=0,A=E.components.length;
D<A;
++D){B=this.containsPoint(E.components[D]);
if(B){break
}}}}else{for(D=0,A=E.components.length;
D<A;
++D){B=this.intersects(E.components[D]);
if(B){break
}}}}if(!B&&E.CLASS_NAME=="OpenLayers.Geometry.Polygon"){var C=this.components[0];
for(D=0,A=C.components.length;
D<A;
++D){B=E.containsPoint(C.components[D]);
if(B){break
}}}return B
},CLASS_NAME:"OpenLayers.Geometry.Polygon"});
OpenLayers.Geometry.Polygon.createRegularPolygon=function(I,F,B,K){var C=Math.PI*((1/B)-(1/2));
if(K){C+=(K/180)*Math.PI
}var A,H,G;
var J=[];
for(var E=0;
E<B;
++E){A=C+(E*2*Math.PI/B);
H=I.x+(F*Math.cos(A));
G=I.y+(F*Math.sin(A));
J.push(new OpenLayers.Geometry.Point(H,G))
}var D=new OpenLayers.Geometry.LinearRing(J);
return new OpenLayers.Geometry.Polygon([D])
};OpenLayers.Geometry.MultiLineString=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.LineString"],initialize:function(A){OpenLayers.Geometry.Collection.prototype.initialize.apply(this,arguments)
},CLASS_NAME:"OpenLayers.Geometry.MultiLineString"});OpenLayers.Geometry.MultiPolygon=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.Polygon"],initialize:function(A){OpenLayers.Geometry.Collection.prototype.initialize.apply(this,arguments)
},CLASS_NAME:"OpenLayers.Geometry.MultiPolygon"});OpenLayers.Geometry.Surface=OpenLayers.Class(OpenLayers.Geometry,{initialize:function(){OpenLayers.Geometry.prototype.initialize.apply(this,arguments)
},CLASS_NAME:"OpenLayers.Geometry.Surface"});OpenLayers.Renderer=OpenLayers.Class({container:null,extent:null,locked:false,size:null,resolution:null,map:null,initialize:function(A,B){this.container=OpenLayers.Util.getElement(A)
},destroy:function(){this.container=null;
this.extent=null;
this.size=null;
this.resolution=null;
this.map=null
},supported:function(){return false
},setExtent:function(A,B){this.extent=A.clone();
if(B){this.resolution=null
}},setSize:function(A){this.size=A.clone();
this.resolution=null
},getResolution:function(){this.resolution=this.resolution||this.map.getResolution();
return this.resolution
},drawFeature:function(A,B){if(B==null){B=A.style
}if(A.geometry){var C=A.geometry.getBounds();
if(C){if(!C.intersectsBounds(this.extent)){B={display:"none"}
}return this.drawGeometry(A.geometry,B,A.id)
}}},drawGeometry:function(C,A,B){},clear:function(){},getFeatureIdFromEvent:function(A){},eraseFeatures:function(C){if(!(C instanceof Array)){C=[C]
}for(var B=0,A=C.length;
B<A;
++B){this.eraseGeometry(C[B].geometry)
}},eraseGeometry:function(A){},CLASS_NAME:"OpenLayers.Renderer"});OpenLayers.ElementsIndexer=OpenLayers.Class({maxZIndex:null,order:null,indices:null,compare:null,initialize:function(A){this.compare=A?OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER_Y_ORDER:OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER_DRAWING_ORDER;
this.order=[];
this.indices={};
this.maxZIndex=0
},insert:function(D){if(this.exists(D)){this.remove(D)
}var G=D.id;
this.determineZIndex(D);
var E=-1;
var F=this.order.length;
var B;
while(F-E>1){B=parseInt((E+F)/2);
var C=this.compare(this,D,OpenLayers.Util.getElement(this.order[B]));
if(C>0){E=B
}else{F=B
}}this.order.splice(F,0,G);
this.indices[G]=this.getZIndex(D);
var A=F+1;
return A<this.order.length?OpenLayers.Util.getElement(this.order[A]):null
},remove:function(B){var D=B.id;
var A=OpenLayers.Util.indexOf(this.order,D);
if(A>=0){this.order.splice(A,1);
delete this.indices[D];
if(this.order.length>0){var C=this.order[this.order.length-1];
this.maxZIndex=this.indices[C]
}else{this.maxZIndex=0
}}},clear:function(){this.order=[];
this.indices={};
this.maxZIndex=0
},exists:function(A){return(this.indices[A.id]!=null)
},getZIndex:function(A){return A._style.graphicZIndex
},determineZIndex:function(A){var B=A._style.graphicZIndex;
if(B==null){B=this.maxZIndex;
A._style.graphicZIndex=B
}else{if(B>this.maxZIndex){this.maxZIndex=B
}}},CLASS_NAME:"OpenLayers.ElementsIndexer"});
OpenLayers.ElementsIndexer.IndexingMethods={Z_ORDER:function(E,D,B){var A=E.getZIndex(D);
var F=0;
if(B){var C=E.getZIndex(B);
F=A-C
}return F
},Z_ORDER_DRAWING_ORDER:function(C,B,A){var D=OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER(C,B,A);
if(A&&D==0){D=1
}return D
},Z_ORDER_Y_ORDER:function(F,E,B){var G=OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER(F,E,B);
if(B&&G==0){var C=E._geometry.getBounds().bottom;
var D=B._geometry.getBounds().bottom;
var A=D-C;
G=(A==0)?1:A
}return G
}};
OpenLayers.Renderer.Elements=OpenLayers.Class(OpenLayers.Renderer,{rendererRoot:null,root:null,xmlns:null,indexer:null,BACKGROUND_ID_SUFFIX:"_background",minimumSymbolizer:{strokeLinecap:"round",strokeOpacity:1,strokeDashstyle:"solid",fillOpacity:1,pointRadius:0},initialize:function(A,B){OpenLayers.Renderer.prototype.initialize.apply(this,arguments);
this.rendererRoot=this.createRenderRoot();
this.root=this.createRoot();
this.rendererRoot.appendChild(this.root);
this.container.appendChild(this.rendererRoot);
if(B&&(B.zIndexing||B.yOrdering)){this.indexer=new OpenLayers.ElementsIndexer(B.yOrdering)
}},destroy:function(){this.clear();
this.rendererRoot=null;
this.root=null;
this.xmlns=null;
OpenLayers.Renderer.prototype.destroy.apply(this,arguments)
},clear:function(){if(this.root){while(this.root.childNodes.length>0){this.root.removeChild(this.root.firstChild)
}}if(this.indexer){this.indexer.clear()
}},getNodeType:function(B,A){},drawGeometry:function(G,D,F){var C=G.CLASS_NAME;
var H=true;
if((C=="OpenLayers.Geometry.Collection")||(C=="OpenLayers.Geometry.MultiPoint")||(C=="OpenLayers.Geometry.MultiLineString")||(C=="OpenLayers.Geometry.MultiPolygon")){for(var B=0,A=G.components.length;
B<A;
B++){H=H&&this.drawGeometry(G.components[B],D,F)
}return H
}H=false;
if(D.display!="none"){if(D.backgroundGraphic){this.redrawBackgroundNode(G.id,G,D,F)
}H=this.redrawNode(G.id,G,D,F)
}if(H==false){var E=document.getElementById(G.id);
if(E){if(E._style.backgroundGraphic){E.parentNode.removeChild(document.getElementById(G.id+this.BACKGROUND_ID_SUFFIX))
}E.parentNode.removeChild(E)
}}return H
},redrawNode:function(G,F,B,E){var C=this.nodeFactory(G,this.getNodeType(F,B));
C._featureId=E;
C._geometry=F;
C._geometryClass=F.CLASS_NAME;
C._style=B;
var A=this.drawGeometryNode(C,F,B);
if(A===false){return false
}C=A.node;
var D=this.indexer?this.indexer.insert(C):null;
if(D){this.root.insertBefore(C,D)
}else{this.root.appendChild(C)
}this.postDraw(C);
return A.complete
},redrawBackgroundNode:function(E,D,B,C){var A=OpenLayers.Util.extend({},B);
A.externalGraphic=A.backgroundGraphic;
A.graphicXOffset=A.backgroundXOffset;
A.graphicYOffset=A.backgroundYOffset;
A.graphicZIndex=A.backgroundGraphicZIndex;
A.backgroundGraphic=null;
A.backgroundXOffset=null;
A.backgroundYOffset=null;
A.backgroundGraphicZIndex=null;
return this.redrawNode(E+this.BACKGROUND_ID_SUFFIX,D,A,null)
},drawGeometryNode:function(C,E,B){B=B||C._style;
OpenLayers.Util.applyDefaults(B,this.minimumSymbolizer);
var A={isFilled:true,isStroked:!!B.strokeWidth};
var D;
switch(E.CLASS_NAME){case"OpenLayers.Geometry.Point":D=this.drawPoint(C,E);
break;
case"OpenLayers.Geometry.LineString":A.isFilled=false;
D=this.drawLineString(C,E);
break;
case"OpenLayers.Geometry.LinearRing":D=this.drawLinearRing(C,E);
break;
case"OpenLayers.Geometry.Polygon":D=this.drawPolygon(C,E);
break;
case"OpenLayers.Geometry.Surface":D=this.drawSurface(C,E);
break;
case"OpenLayers.Geometry.Rectangle":D=this.drawRectangle(C,E);
break;
default:break
}C._style=B;
C._options=A;
if(D!=false){return{node:this.setStyle(C,B,A,E),complete:D}
}else{return false
}},postDraw:function(A){},drawPoint:function(A,B){},drawLineString:function(A,B){},drawLinearRing:function(A,B){},drawPolygon:function(A,B){},drawRectangle:function(A,B){},drawCircle:function(A,B){},drawSurface:function(A,B){},getFeatureIdFromEvent:function(A){var D=A.target;
var B=D&&D.correspondingUseElement;
var C=B?B:(D||A.srcElement);
var E=C._featureId;
return E
},eraseGeometry:function(F){if((F.CLASS_NAME=="OpenLayers.Geometry.MultiPoint")||(F.CLASS_NAME=="OpenLayers.Geometry.MultiLineString")||(F.CLASS_NAME=="OpenLayers.Geometry.MultiPolygon")||(F.CLASS_NAME=="OpenLayers.Geometry.Collection")){for(var D=0,A=F.components.length;
D<A;
D++){this.eraseGeometry(F.components[D])
}}else{var C=OpenLayers.Util.getElement(F.id);
if(C&&C.parentNode){if(C.geometry){C.geometry.destroy();
C.geometry=null
}C.parentNode.removeChild(C);
if(this.indexer){this.indexer.remove(C)
}if(C._style.backgroundGraphic){var B=F.id+this.BACKGROUND_ID_SUFFIX;
var E=OpenLayers.Util.getElement(B);
if(E&&E.parentNode){E.parentNode.removeChild(E)
}}}}},nodeFactory:function(C,A){var B=OpenLayers.Util.getElement(C);
if(B){if(!this.nodeTypeCompare(B,A)){B.parentNode.removeChild(B);
B=this.nodeFactory(C,A)
}}else{B=this.createNode(A,C)
}return B
},nodeTypeCompare:function(B,A){},createNode:function(A,B){},isComplexSymbol:function(A){return(A!="circle")&&!!A
},CLASS_NAME:"OpenLayers.Renderer.Elements"});
OpenLayers.Renderer.symbol={star:[350,75,379,161,469,161,397,215,423,301,350,250,277,301,303,215,231,161,321,161,350,75],cross:[4,0,6,0,6,4,10,4,10,6,6,6,6,10,4,10,4,6,0,6,0,4,4,4,4,0],x:[0,0,25,0,50,35,75,0,100,0,65,50,100,100,75,100,50,65,25,100,0,100,35,50,0,0],square:[0,0,0,1,1,1,1,0,0,0],triangle:[0,10,10,10,5,0,0,10]};OpenLayers.Renderer.SVG=OpenLayers.Class(OpenLayers.Renderer.Elements,{xmlns:"http://www.w3.org/2000/svg",xlinkns:"http://www.w3.org/1999/xlink",MAX_PIXEL:15000,translationParameters:null,symbolSize:{},initialize:function(A){if(!this.supported()){return 
}OpenLayers.Renderer.Elements.prototype.initialize.apply(this,arguments);
this.translationParameters={x:0,y:0}
},destroy:function(){OpenLayers.Renderer.Elements.prototype.destroy.apply(this,arguments)
},supported:function(){var A="http://www.w3.org/TR/SVG11/feature#";
return(document.implementation&&(document.implementation.hasFeature("org.w3c.svg","1.0")||document.implementation.hasFeature(A+"SVG","1.1")||document.implementation.hasFeature(A+"BasicStructure","1.1")))
},inValidRange:function(A,E,B){var D=A+(B?0:this.translationParameters.x);
var C=E+(B?0:this.translationParameters.y);
return(D>=-this.MAX_PIXEL&&D<=this.MAX_PIXEL&&C>=-this.MAX_PIXEL&&C<=this.MAX_PIXEL)
},setExtent:function(B,D){OpenLayers.Renderer.Elements.prototype.setExtent.apply(this,arguments);
var A=this.getResolution();
var F=-B.left/A;
var E=B.top/A;
if(D){this.left=F;
this.top=E;
var C="0 0 "+this.size.w+" "+this.size.h;
this.rendererRoot.setAttributeNS(null,"viewBox",C);
this.translate(0,0);
return true
}else{var G=this.translate(F-this.left,E-this.top);
if(!G){this.setExtent(B,true)
}return G
}},translate:function(A,C){if(!this.inValidRange(A,C,true)){return false
}else{var B="";
if(A||C){B="translate("+A+","+C+")"
}this.root.setAttributeNS(null,"transform",B);
this.translationParameters={x:A,y:C};
return true
}},setSize:function(A){OpenLayers.Renderer.prototype.setSize.apply(this,arguments);
this.rendererRoot.setAttributeNS(null,"width",this.size.w);
this.rendererRoot.setAttributeNS(null,"height",this.size.h)
},getNodeType:function(C,B){var A=null;
switch(C.CLASS_NAME){case"OpenLayers.Geometry.Point":if(B.externalGraphic){A="image"
}else{if(this.isComplexSymbol(B.graphicName)){A="use"
}else{A="circle"
}}break;
case"OpenLayers.Geometry.Rectangle":A="rect";
break;
case"OpenLayers.Geometry.LineString":A="polyline";
break;
case"OpenLayers.Geometry.LinearRing":A="polygon";
break;
case"OpenLayers.Geometry.Polygon":case"OpenLayers.Geometry.Curve":case"OpenLayers.Geometry.Surface":A="path";
break;
default:break
}return A
},setStyle:function(F,C,P){C=C||F._style;
P=P||F._options;
var A=parseFloat(F.getAttributeNS(null,"r"));
var K=1;
var L;
if(F._geometryClass=="OpenLayers.Geometry.Point"&&A){if(C.externalGraphic){L=this.getPosition(F);
if(C.graphicWidth&&C.graphicHeight){F.setAttributeNS(null,"preserveAspectRatio","none")
}var E=C.graphicWidth||C.graphicHeight;
var M=C.graphicHeight||C.graphicWidth;
E=E?E:C.pointRadius*2;
M=M?M:C.pointRadius*2;
var J=(C.graphicXOffset!=undefined)?C.graphicXOffset:-(0.5*E);
var G=(C.graphicYOffset!=undefined)?C.graphicYOffset:-(0.5*M);
var I=C.graphicOpacity||C.fillOpacity;
F.setAttributeNS(null,"x",(L.x+J).toFixed());
F.setAttributeNS(null,"y",(L.y+G).toFixed());
F.setAttributeNS(null,"width",E);
F.setAttributeNS(null,"height",M);
F.setAttributeNS(this.xlinkns,"href",C.externalGraphic);
F.setAttributeNS(null,"style","opacity: "+I)
}else{if(this.isComplexSymbol(C.graphicName)){var H=C.pointRadius*3;
var O=H*2;
var D=this.importSymbol(C.graphicName);
var B="#"+D;
L=this.getPosition(F);
K=this.symbolSize[D]/O;
if(F.getAttributeNS(this.xlinkns,"href")!=B){F.setAttributeNS(this.xlinkns,"href",B)
}else{if(O!=parseFloat(F.getAttributeNS(null,"width"))){F.style.visibility="hidden";
this.container.scrollLeft=this.container.scrollLeft
}}F.setAttributeNS(null,"width",O);
F.setAttributeNS(null,"height",O);
F.setAttributeNS(null,"x",L.x-H);
F.setAttributeNS(null,"y",L.y-H);
F.style.visibility=""
}else{F.setAttributeNS(null,"r",C.pointRadius)
}}if(typeof C.rotation!="undefined"&&L){var N=OpenLayers.String.format("rotate(${0} ${1} ${2})",[C.rotation,L.x,L.y]);
F.setAttributeNS(null,"transform",N)
}}if(P.isFilled){F.setAttributeNS(null,"fill",C.fillColor);
F.setAttributeNS(null,"fill-opacity",C.fillOpacity)
}else{F.setAttributeNS(null,"fill","none")
}if(P.isStroked){F.setAttributeNS(null,"stroke",C.strokeColor);
F.setAttributeNS(null,"stroke-opacity",C.strokeOpacity);
F.setAttributeNS(null,"stroke-width",C.strokeWidth*K);
F.setAttributeNS(null,"stroke-linecap",C.strokeLinecap);
F.setAttributeNS(null,"stroke-linejoin","round");
F.setAttributeNS(null,"stroke-dasharray",this.dashStyle(C,K))
}else{F.setAttributeNS(null,"stroke","none")
}if(C.pointerEvents){F.setAttributeNS(null,"pointer-events",C.pointerEvents)
}if(C.title!=null){F.setAttributeNS(null,"title",C.title)
}if(C.cursor!=null){F.setAttributeNS(null,"cursor",C.cursor)
}return F
},dashStyle:function(C,B){var A=C.strokeWidth*B;
switch(C.strokeDashstyle){case"solid":return"none";
case"dot":return[1,4*A].join();
case"dash":return[4*A,4*A].join();
case"dashdot":return[4*A,4*A,1,4*A].join();
case"longdash":return[8*A,4*A].join();
case"longdashdot":return[8*A,4*A,1,4*A].join();
default:return C.strokeDashstyle.replace(/ /g,",")
}},createNode:function(A,C){var B=document.createElementNS(this.xmlns,A);
if(C){B.setAttributeNS(null,"id",C)
}return B
},nodeTypeCompare:function(B,A){return(A==B.nodeName)
},createRenderRoot:function(){return this.nodeFactory(this.container.id+"_svgRoot","svg")
},createRoot:function(){return this.nodeFactory(this.container.id+"_root","g")
},createDefs:function(){var A=this.nodeFactory("ol-renderer-defs","defs");
this.rendererRoot.appendChild(A);
return A
},drawPoint:function(A,B){return this.drawCircle(A,B,1)
},drawCircle:function(D,E,B){var C=this.getResolution();
var A=(E.x/C+this.left);
var F=(this.top-E.y/C);
if(this.inValidRange(A,F)){D.setAttributeNS(null,"cx",A);
D.setAttributeNS(null,"cy",F);
D.setAttributeNS(null,"r",B);
return D
}else{return false
}},drawLineString:function(B,C){var A=this.getComponentsString(C.components);
if(A.path){B.setAttributeNS(null,"points",A.path);
return(A.complete?B:null)
}else{return false
}},drawLinearRing:function(B,C){var A=this.getComponentsString(C.components);
if(A.path){B.setAttributeNS(null,"points",A.path);
return(A.complete?B:null)
}else{return false
}},drawPolygon:function(B,G){var F="";
var H=true;
var A=true;
var C,I;
for(var D=0,E=G.components.length;
D<E;
D++){F+=" M";
C=this.getComponentsString(G.components[D].components," ");
I=C.path;
if(I){F+=" "+I;
A=C.complete&&A
}else{H=false
}}F+=" z";
if(H){B.setAttributeNS(null,"d",F);
B.setAttributeNS(null,"fill-rule","evenodd");
return A?B:null
}else{return false
}},drawRectangle:function(C,D){var B=this.getResolution();
var A=(D.x/B+this.left);
var E=(this.top-D.y/B);
if(this.inValidRange(A,E)){C.setAttributeNS(null,"x",A);
C.setAttributeNS(null,"y",E);
C.setAttributeNS(null,"width",D.width/B);
C.setAttributeNS(null,"height",D.height/B);
return C
}else{return false
}},drawSurface:function(E,G){var F=null;
var B=true;
for(var D=0,A=G.components.length;
D<A;
D++){if((D%3)==0&&(D/3)==0){var C=this.getShortString(G.components[D]);
if(!C){B=false
}F="M "+C
}else{if((D%3)==1){var C=this.getShortString(G.components[D]);
if(!C){B=false
}F+=" C "+C
}else{var C=this.getShortString(G.components[D]);
if(!C){B=false
}F+=" "+C
}}}F+=" Z";
if(B){E.setAttributeNS(null,"d",F);
return E
}else{return false
}},getComponentsString:function(E,D){var G=[];
var A=true;
var F=E.length;
var J=[];
var H,I,B;
for(var C=0;
C<F;
C++){I=E[C];
G.push(I);
H=this.getShortString(I);
if(H){J.push(H)
}else{if(C>0){if(this.getShortString(E[C-1])){J.push(this.clipLine(E[C],E[C-1]))
}}if(C<F-1){if(this.getShortString(E[C+1])){J.push(this.clipLine(E[C],E[C+1]))
}}A=false
}}return{path:J.join(D||","),complete:A}
},clipLine:function(E,H){if(H.equals(E)){return""
}var F=this.getResolution();
var B=this.MAX_PIXEL-this.translationParameters.x;
var A=this.MAX_PIXEL-this.translationParameters.y;
var D=H.x/F+this.left;
var J=this.top-H.y/F;
var C=E.x/F+this.left;
var I=this.top-E.y/F;
var G;
if(C<-B||C>B){G=(I-J)/(C-D);
C=C<0?-B:B;
I=J+(C-D)*G
}if(I<-A||I>A){G=(C-D)/(I-J);
I=I<0?-A:A;
C=D+(I-J)*G
}return C+","+I
},getShortString:function(B){var C=this.getResolution();
var A=(B.x/C+this.left);
var D=(this.top-B.y/C);
if(this.inValidRange(A,D)){return A+","+D
}else{return false
}},getPosition:function(A){return({x:parseFloat(A.getAttributeNS(null,"cx")),y:parseFloat(A.getAttributeNS(null,"cy"))})
},importSymbol:function(E){if(!this.defs){this.defs=this.createDefs()
}var B=this.container.id+"-"+E;
if(document.getElementById(B)!=null){return B
}var D=OpenLayers.Renderer.symbol[E];
if(!D){throw new Error(E+" is not a valid symbol name");
return 
}var G=this.nodeFactory(B,"symbol");
var C=this.nodeFactory(null,"polygon");
G.appendChild(C);
var L=new OpenLayers.Bounds(Number.MAX_VALUE,Number.MAX_VALUE,0,0);
var J="";
var I,H;
for(var F=0;
F<D.length;
F=F+2){I=D[F];
H=D[F+1];
L.left=Math.min(L.left,I);
L.bottom=Math.min(L.bottom,H);
L.right=Math.max(L.right,I);
L.top=Math.max(L.top,H);
J+=" "+I+","+H
}C.setAttributeNS(null,"points",J);
var A=L.getWidth();
var K=L.getHeight();
var M=[L.left-A,L.bottom-K,A*3,K*3];
G.setAttributeNS(null,"viewBox",M.join(" "));
this.symbolSize[B]=Math.max(A,K)*3;
this.defs.appendChild(G);
return G.id
},CLASS_NAME:"OpenLayers.Renderer.SVG"});OpenLayers.Renderer.Canvas=OpenLayers.Class(OpenLayers.Renderer,{root:null,canvas:null,features:null,geometryMap:null,initialize:function(A){OpenLayers.Renderer.prototype.initialize.apply(this,arguments);
this.root=document.createElement("canvas");
this.container.appendChild(this.root);
this.canvas=this.root.getContext("2d");
this.features={};
this.geometryMap={}
},eraseGeometry:function(A){this.eraseFeatures(this.features[this.geometryMap[A.id]][0])
},supported:function(){var A=document.createElement("canvas");
return !!A.getContext
},setExtent:function(A){this.extent=A.clone();
this.resolution=null;
this.redraw()
},setSize:function(A){this.size=A.clone();
this.root.style.width=A.w+"px";
this.root.style.height=A.h+"px";
this.root.width=A.w;
this.root.height=A.h;
this.resolution=null
},drawFeature:function(A,B){if(B==null){B=A.style
}B=OpenLayers.Util.extend({fillColor:"#000000",strokeColor:"#000000",strokeWidth:2,fillOpacity:1,strokeOpacity:1},B);
this.features[A.id]=[A,B];
this.geometryMap[A.geometry.id]=A.id;
this.redraw()
},drawGeometry:function(D,C){var B=D.CLASS_NAME;
if((B=="OpenLayers.Geometry.Collection")||(B=="OpenLayers.Geometry.MultiPoint")||(B=="OpenLayers.Geometry.MultiLineString")||(B=="OpenLayers.Geometry.MultiPolygon")){for(var A=0;
A<D.components.length;
A++){this.drawGeometry(D.components[A],C)
}return 
}switch(D.CLASS_NAME){case"OpenLayers.Geometry.Point":this.drawPoint(D,C);
break;
case"OpenLayers.Geometry.LineString":this.drawLineString(D,C);
break;
case"OpenLayers.Geometry.LinearRing":this.drawLinearRing(D,C);
break;
case"OpenLayers.Geometry.Polygon":this.drawPolygon(D,C);
break;
default:break
}},drawExternalGraphic:function(I,A){var E=new Image();
E.src=A.externalGraphic;
var C=A.graphicWidth||A.graphicHeight;
var H=A.graphicHeight||A.graphicWidth;
C=C?C:A.pointRadius*2;
H=H?H:A.pointRadius*2;
var G=(A.graphicXOffset!=undefined)?A.graphicXOffset:-(0.5*C);
var D=(A.graphicYOffset!=undefined)?A.graphicYOffset:-(0.5*H);
var F=A.graphicOpacity||A.fillOpacity;
var B={img:E,x:(I[0]+G),y:(I[1]+D),width:C,height:H,canvas:this.canvas};
E.onload=OpenLayers.Function.bind(function(){this.canvas.drawImage(this.img,this.x,this.y,this.width,this.height)
},B)
},setCanvasStyle:function(B,A){if(B=="fill"){this.canvas.globalAlpha=A.fillOpacity;
this.canvas.fillStyle=A.fillColor
}else{if(B=="stroke"){this.canvas.globalAlpha=A.strokeOpacity;
this.canvas.strokeStyle=A.strokeColor;
this.canvas.lineWidth=A.strokeWidth
}else{this.canvas.globalAlpha=0;
this.canvas.lineWidth=1
}}},drawPoint:function(C,A){var B=this.getLocalXY(C);
if(A.externalGraphic){this.drawExternalGraphic(B,A)
}else{this.setCanvasStyle("fill",A);
this.canvas.beginPath();
this.canvas.arc(B[0],B[1],6,0,Math.PI*2,true);
this.canvas.fill();
this.setCanvasStyle("stroke",A);
this.canvas.beginPath();
this.canvas.arc(B[0],B[1],6,0,Math.PI*2,true);
this.canvas.stroke();
this.setCanvasStyle("reset")
}},drawLineString:function(D,B){this.setCanvasStyle("stroke",B);
this.canvas.beginPath();
var E=this.getLocalXY(D.components[0]);
this.canvas.moveTo(E[0],E[1]);
for(var A=1;
A<D.components.length;
A++){var C=this.getLocalXY(D.components[A]);
this.canvas.lineTo(C[0],C[1])
}this.canvas.stroke();
this.setCanvasStyle("reset")
},drawLinearRing:function(E,C){this.setCanvasStyle("fill",C);
this.canvas.beginPath();
var F=this.getLocalXY(E.components[0]);
this.canvas.moveTo(F[0],F[1]);
for(var B=1;
B<E.components.length-1;
B++){var D=this.getLocalXY(E.components[B]);
this.canvas.lineTo(D[0],D[1])
}this.canvas.fill();
var A=this.canvas.lineWidth;
this.setCanvasStyle("stroke",C);
this.canvas.beginPath();
var F=this.getLocalXY(E.components[0]);
this.canvas.moveTo(F[0],F[1]);
for(var B=1;
B<E.components.length;
B++){var D=this.getLocalXY(E.components[B]);
this.canvas.lineTo(D[0],D[1])
}this.canvas.stroke();
this.setCanvasStyle("reset")
},drawPolygon:function(C,B){this.drawLinearRing(C.components[0],B);
for(var A=1;
A<C.components.length;
A++){this.drawLinearRing(C.components[A],{fillOpacity:0,strokeWidth:0,strokeOpacity:0,strokeColor:"#000000",fillColor:"#000000"})
}},getLocalXY:function(B){var C=this.getResolution();
var D=this.extent;
var A=(B.x/C+(-D.left/C));
var E=((D.top/C)-B.y/C);
return[A,E]
},clear:function(){this.canvas.clearRect(0,0,this.root.width,this.root.height)
},getFeatureIdFromEvent:function(A){var F=this.map.getLonLatFromPixel(A.xy);
var B=this.getResolution();
var E=new OpenLayers.Bounds(F.lon-B*5,F.lat-B*5,F.lon+B*5,F.lat+B*5);
var C=E.toGeometry();
for(var D in this.features){if(!this.features.hasOwnProperty(D)){continue
}if(this.features[D][0].geometry.intersects(C)){return D
}}return null
},eraseFeatures:function(B){if(!(B instanceof Array)){B=[B]
}for(var A=0;
A<B.length;
++A){delete this.features[B[A].id]
}this.redraw()
},redraw:function(){if(!this.locked){this.clear();
for(var A in this.features){if(!this.features.hasOwnProperty(A)){continue
}if(!this.features[A][0].geometry){continue
}this.drawGeometry(this.features[A][0].geometry,this.features[A][1])
}}},CLASS_NAME:"OpenLayers.Renderer.Canvas"});OpenLayers.Renderer.VML=OpenLayers.Class(OpenLayers.Renderer.Elements,{xmlns:"urn:schemas-microsoft-com:vml",symbolCache:{},offset:null,initialize:function(B){if(!this.supported()){return 
}if(!document.namespaces.olv){document.namespaces.add("olv",this.xmlns);
var E=document.createStyleSheet();
var C=["shape","rect","oval","fill","stroke","imagedata","group","textbox"];
for(var D=0,A=C.length;
D<A;
D++){E.addRule("olv\\:"+C[D],"behavior: url(#default#VML); position: absolute; display: inline-block;")
}}OpenLayers.Renderer.Elements.prototype.initialize.apply(this,arguments);
this.offset={x:0,y:0}
},destroy:function(){OpenLayers.Renderer.Elements.prototype.destroy.apply(this,arguments)
},supported:function(){return !!(document.namespaces)
},setExtent:function(C,D){OpenLayers.Renderer.Elements.prototype.setExtent.apply(this,arguments);
var A=this.getResolution();
var F=C.left/A;
var E=C.top/A-this.size.h;
if(D){this.offset={x:F,y:E};
F=0;
E=0
}else{F=F-this.offset.x;
E=E-this.offset.y
}var G=F+" "+E;
this.root.coordorigin=G;
var B=this.size.w+" "+this.size.h;
this.root.coordsize=B;
this.root.style.flip="y";
return true
},setSize:function(A){OpenLayers.Renderer.prototype.setSize.apply(this,arguments);
this.rendererRoot.style.width=this.size.w+"px";
this.rendererRoot.style.height=this.size.h+"px";
this.root.style.width=this.size.w+"px";
this.root.style.height=this.size.h+"px"
},getNodeType:function(C,B){var A=null;
switch(C.CLASS_NAME){case"OpenLayers.Geometry.Point":if(B.externalGraphic){A="olv:rect"
}else{if(this.isComplexSymbol(B.graphicName)){A="olv:shape"
}else{A="olv:oval"
}}break;
case"OpenLayers.Geometry.Rectangle":A="olv:rect";
break;
case"OpenLayers.Geometry.LineString":case"OpenLayers.Geometry.LinearRing":case"OpenLayers.Geometry.Polygon":case"OpenLayers.Geometry.Curve":case"OpenLayers.Geometry.Surface":A="olv:shape";
break;
default:break
}return A
},setStyle:function(D,B,P,K){B=B||D._style;
P=P||D._options;
var I=1;
if(D._geometryClass=="OpenLayers.Geometry.Point"){if(B.externalGraphic){var C=B.graphicWidth||B.graphicHeight;
var L=B.graphicHeight||B.graphicWidth;
C=C?C:B.pointRadius*2;
L=L?L:B.pointRadius*2;
var F=this.getResolution();
var H=(B.graphicXOffset!=undefined)?B.graphicXOffset:-(0.5*C);
var E=(B.graphicYOffset!=undefined)?B.graphicYOffset:-(0.5*L);
D.style.left=((K.x/F-this.offset.x)+H).toFixed();
D.style.top=((K.y/F-this.offset.y)-(E+L)).toFixed();
D.style.width=C+"px";
D.style.height=L+"px";
D.style.flip="y";
B.fillColor="none";
P.isStroked=false
}else{if(this.isComplexSymbol(B.graphicName)){var A=this.importSymbol(B.graphicName);
var O=A.extent;
var C=O.getWidth();
var L=O.getHeight();
D.setAttribute("path",A.path);
D.setAttribute("coordorigin",O.left+","+O.bottom);
D.setAttribute("coordsize",C+","+L);
D.style.left=O.left+"px";
D.style.top=O.bottom+"px";
D.style.width=C+"px";
D.style.height=L+"px";
this.drawCircle(D,K,B.pointRadius);
D.style.flip="y"
}else{this.drawCircle(D,K,B.pointRadius)
}}}if(P.isFilled){D.setAttribute("fillcolor",B.fillColor)
}else{D.setAttribute("filled","false")
}var J=D.getElementsByTagName("fill");
var N=(J.length==0)?null:J[0];
if(!P.isFilled){if(N){D.removeChild(N)
}}else{if(!N){N=this.createNode("olv:fill",D.id+"_fill")
}N.setAttribute("opacity",B.fillOpacity);
if(D._geometryClass=="OpenLayers.Geometry.Point"&&B.externalGraphic){if(B.graphicOpacity){N.setAttribute("opacity",B.graphicOpacity)
}N.setAttribute("src",B.externalGraphic);
N.setAttribute("type","frame");
if(!(B.graphicWidth&&B.graphicHeight)){N.aspect="atmost"
}}if(N.parentNode!=D){D.appendChild(N)
}}if(typeof B.rotation!="undefined"){if(B.externalGraphic){this.graphicRotate(D,H,E);
N.setAttribute("opacity",0)
}else{D.style.rotation=B.rotation
}}if(P.isStroked){D.setAttribute("strokecolor",B.strokeColor);
D.setAttribute("strokeweight",B.strokeWidth+"px")
}else{D.setAttribute("stroked","false")
}var G=D.getElementsByTagName("stroke");
var M=(G.length==0)?null:G[0];
if(!P.isStroked){if(M){D.removeChild(M)
}}else{if(!M){M=this.createNode("olv:stroke",D.id+"_stroke");
D.appendChild(M)
}M.setAttribute("opacity",B.strokeOpacity);
M.setAttribute("endcap",!B.strokeLinecap||B.strokeLinecap=="butt"?"flat":B.strokeLinecap);
M.setAttribute("dashstyle",this.dashStyle(B))
}if(B.title!=null){D.title=B.title
}if(B.cursor!="inherit"&&B.cursor!=null){D.style.cursor=B.cursor
}return D
},graphicRotate:function(N,R,F){var Q=Q||N._style;
var D=N._options;
var A,J;
if(!(Q.graphicWidth&&Q.graphicHeight)){var S=new Image();
S.onreadystatechange=OpenLayers.Function.bind(function(){if(S.readyState=="complete"||S.readyState=="interactive"){A=S.width/S.height;
J=Math.max(Q.pointRadius*2,Q.graphicWidth||0,Q.graphicHeight||0);
R=R*A;
Q.graphicWidth=J*A;
Q.graphicHeight=J;
this.graphicRotate(N,R,F)
}},this);
S.src=Q.externalGraphic;
return 
}else{J=Math.max(Q.graphicWidth,Q.graphicHeight);
A=Q.graphicWidth/Q.graphicHeight
}var M=Math.round(Q.graphicWidth||J*A);
var K=Math.round(Q.graphicHeight||J);
N.style.width=M+"px";
N.style.height=K+"px";
var L=document.getElementById(N.id+"_image");
if(!L){L=this.createNode("olv:imagedata",N.id+"_image");
N.appendChild(L)
}L.style.width=M+"px";
L.style.height=K+"px";
L.src=Q.externalGraphic;
L.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='', sizingMethod='scale')";
var O=Q.rotation*Math.PI/180;
var H=Math.sin(O);
var E=Math.cos(O);
var G="progid:DXImageTransform.Microsoft.Matrix(M11="+E+",M12="+(-H)+",M21="+H+",M22="+E+",SizingMethod='auto expand')\n";
var B=Q.graphicOpacity||Q.fillOpacity;
if(B&&B!=1){G+="progid:DXImageTransform.Microsoft.BasicImage(opacity="+B+")\n"
}N.style.filter=G;
var P=new OpenLayers.Geometry.Point(-R,-F);
var C=new OpenLayers.Bounds(0,0,M,K).toGeometry();
C.rotate(Q.rotation,P);
var I=C.getBounds();
N.style.left=Math.round(parseInt(N.style.left)+I.left)+"px";
N.style.top=Math.round(parseInt(N.style.top)-I.bottom)+"px"
},postDraw:function(A){var C=A._style.fillColor;
var B=A._style.strokeColor;
if(C=="none"&&A.getAttribute("fillcolor")!=C){A.setAttribute("fillcolor",C)
}if(B=="none"&&A.getAttribute("strokecolor")!=B){A.setAttribute("strokecolor",B)
}},setNodeDimension:function(B,E){var D=E.getBounds();
if(D){var A=this.getResolution();
var C=new OpenLayers.Bounds((D.left/A-this.offset.x).toFixed(),(D.bottom/A-this.offset.y).toFixed(),(D.right/A-this.offset.x).toFixed(),(D.top/A-this.offset.y).toFixed());
B.style.left=C.left+"px";
B.style.top=C.top+"px";
B.style.width=C.getWidth()+"px";
B.style.height=C.getHeight()+"px";
B.coordorigin=C.left+" "+C.top;
B.coordsize=C.getWidth()+" "+C.getHeight()
}},dashStyle:function(A){var C=A.strokeDashstyle;
switch(C){case"solid":case"dot":case"dash":case"dashdot":case"longdash":case"longdashdot":return C;
default:var B=C.split(/[ ,]/);
if(B.length==2){if(1*B[0]>=2*B[1]){return"longdash"
}return(B[0]==1||B[1]==1)?"dot":"dash"
}else{if(B.length==4){return(1*B[0]>=2*B[1])?"longdashdot":"dashdot"
}}return"solid"
}},createNode:function(A,C){var B=document.createElement(A);
if(C){B.setAttribute("id",C)
}B.setAttribute("unselectable","on",0);
B.onselectstart=function(){return(false)
};
return B
},nodeTypeCompare:function(C,B){var D=B;
var A=D.indexOf(":");
if(A!=-1){D=D.substr(A+1)
}var E=C.nodeName;
A=E.indexOf(":");
if(A!=-1){E=E.substr(A+1)
}return(D==E)
},createRenderRoot:function(){return this.nodeFactory(this.container.id+"_vmlRoot","div")
},createRoot:function(){return this.nodeFactory(this.container.id+"_root","olv:group")
},drawPoint:function(A,B){return this.drawCircle(A,B,1)
},drawCircle:function(D,E,A){if(!isNaN(E.x)&&!isNaN(E.y)){var B=this.getResolution();
D.style.left=((E.x/B-this.offset.x).toFixed()-A)+"px";
D.style.top=((E.y/B-this.offset.y).toFixed()-A)+"px";
var C=A*2;
D.style.width=C+"px";
D.style.height=C+"px";
return D
}return false
},drawLineString:function(A,B){return this.drawLine(A,B,false)
},drawLinearRing:function(A,B){return this.drawLine(A,B,true)
},drawLine:function(B,J,G){this.setNodeDimension(B,J);
var C=this.getResolution();
var A=J.components.length;
var E=new Array(A);
var H,K,I;
for(var F=0;
F<A;
F++){H=J.components[F];
K=(H.x/C-this.offset.x);
I=(H.y/C-this.offset.y);
E[F]=" "+K.toFixed()+","+I.toFixed()+" l "
}var D=(G)?" x e":" e";
B.path="m"+E.join("")+D;
return B
},drawPolygon:function(B,J){this.setNodeDimension(B,J);
var C=this.getResolution();
var L=[];
var F,E,D,H,A,G,K,I;
for(D=0,H=J.components.length;
D<H;
D++){F=J.components[D];
L.push("m");
for(E=0,A=F.components.length;
E<A;
E++){G=F.components[E];
K=G.x/C-this.offset.x;
I=G.y/C-this.offset.y;
L.push(" "+K.toFixed()+","+I.toFixed());
if(E==0){L.push(" l")
}}L.push(" x ")
}L.push("e");
B.path=L.join("");
return B
},drawRectangle:function(B,C){var A=this.getResolution();
B.style.left=(C.x/A-this.offset.x)+"px";
B.style.top=(C.y/A-this.offset.y)+"px";
B.style.width=C.width/A+"px";
B.style.height=C.height/A+"px";
return B
},drawSurface:function(A,G){this.setNodeDimension(A,G);
var B=this.getResolution();
var I=[];
var D,H,F;
for(var C=0,E=G.components.length;
C<E;
C++){D=G.components[C];
H=D.x/B-this.offset.x;
F=D.y/B-this.offset.y;
if((C%3)==0&&(C/3)==0){I.push("m")
}else{if((C%3)==1){I.push(" c")
}}I.push(" "+H+","+F)
}I.push(" x e");
A.path=I.join("");
return A
},importSymbol:function(B){var H=this.container.id+"-"+B;
var A=this.symbolCache[H];
if(A){return A
}var E=OpenLayers.Renderer.symbol[B];
if(!E){throw new Error(B+" is not a valid symbol name");
return 
}var G=new OpenLayers.Bounds(Number.MAX_VALUE,Number.MAX_VALUE,0,0);
var D=["m"];
for(var C=0;
C<E.length;
C=C+2){x=E[C];
y=E[C+1];
G.left=Math.min(G.left,x);
G.bottom=Math.min(G.bottom,y);
G.right=Math.max(G.right,x);
G.top=Math.max(G.top,y);
D.push(x);
D.push(y);
if(C==0){D.push("l")
}}D.push("x e");
var F=D.join(" ");
A={path:F,extent:G};
this.symbolCache[H]=A;
return A
},CLASS_NAME:"OpenLayers.Renderer.VML"});OpenLayers.Layer.Vector=OpenLayers.Class(OpenLayers.Layer,{EVENT_TYPES:["beforefeatureadded","beforefeaturesadded","featureadded","featuresadded","beforefeatureremoved","featureremoved","featuresremoved","beforefeatureselected","featureselected","featureunselected","beforefeaturemodified","featuremodified","afterfeaturemodified","refresh"],isBaseLayer:false,isFixed:false,isVector:true,features:null,selectedFeatures:null,unrenderedFeatures:null,reportError:true,style:null,styleMap:null,strategies:null,protocol:null,renderers:["SVG","VML","Canvas"],renderer:null,rendererOptions:null,geometryType:null,drawn:false,initialize:function(C,B){this.EVENT_TYPES=OpenLayers.Layer.Vector.prototype.EVENT_TYPES.concat(OpenLayers.Layer.prototype.EVENT_TYPES);
OpenLayers.Layer.prototype.initialize.apply(this,arguments);
if(!this.renderer||!this.renderer.supported()){this.assignRenderer()
}if(!this.renderer||!this.renderer.supported()){this.renderer=null;
this.displayError()
}if(!this.styleMap){this.styleMap=new OpenLayers.StyleMap()
}this.features=[];
this.selectedFeatures=[];
this.unrenderedFeatures={};
if(this.strategies){for(var D=0,A=this.strategies.length;
D<A;
D++){this.strategies[D].setLayer(this)
}}},destroy:function(){if(this.strategies){var C,B,A;
for(B=0,A=this.strategies.length;
B<A;
B++){C=this.strategies[B];
if(C.autoDestroy){C.destroy()
}}this.strategies=null
}if(this.protocol){if(this.protocol.autoDestroy){this.protocol.destroy()
}this.protocol=null
}this.destroyFeatures();
this.features=null;
this.selectedFeatures=null;
this.unrenderedFeatures=null;
if(this.renderer){this.renderer.destroy()
}this.renderer=null;
this.geometryType=null;
this.drawn=null;
OpenLayers.Layer.prototype.destroy.apply(this,arguments)
},refresh:function(A){if(this.inRange&&this.visibility){this.events.triggerEvent("refresh",A)
}},assignRenderer:function(){for(var C=0,A=this.renderers.length;
C<this.renderers.length;
C++){var B=OpenLayers.Renderer[this.renderers[C]];
if(B&&B.prototype.supported()){this.renderer=new B(this.div,this.rendererOptions);
break
}}},displayError:function(){if(this.reportError){OpenLayers.Console.userError(OpenLayers.i18n("browserNotSupported",{renderers:this.renderers.join("\n")}))
}},setMap:function(C){OpenLayers.Layer.prototype.setMap.apply(this,arguments);
if(!this.renderer){this.map.removeLayer(this)
}else{this.renderer.map=this.map;
this.renderer.setSize(this.map.getSize())
}if(this.strategies){var D,B,A;
for(B=0,A=this.strategies.length;
B<A;
B++){D=this.strategies[B];
if(D.autoActivate){D.activate()
}}}},removeMap:function(C){if(this.strategies){var D,B,A;
for(B=0,A=this.strategies.length;
B<A;
B++){D=this.strategies[B];
if(D.autoActivate){D.deactivate()
}}}},onMapResize:function(){OpenLayers.Layer.prototype.onMapResize.apply(this,arguments);
this.renderer.setSize(this.map.getSize())
},moveTo:function(G,B,H){OpenLayers.Layer.prototype.moveTo.apply(this,arguments);
var E=true;
if(!H){this.renderer.root.style.visibility="hidden";
this.div.style.left=-parseInt(this.map.layerContainerDiv.style.left)+"px";
this.div.style.top=-parseInt(this.map.layerContainerDiv.style.top)+"px";
var F=this.map.getExtent();
E=this.renderer.setExtent(F,B);
this.renderer.root.style.visibility="visible";
if(navigator.userAgent.toLowerCase().indexOf("gecko")!=-1){this.div.scrollLeft=this.div.scrollLeft
}if(!B&&E){for(var D in this.unrenderedFeatures){var C=this.unrenderedFeatures[D];
this.drawFeature(C)
}}}if(!this.drawn||B||!E){this.drawn=true;
var C;
for(var D=0,A=this.features.length;
D<A;
D++){if(D!=(this.features.length-1)){this.renderer.locked=true
}else{this.renderer.locked=false
}C=this.features[D];
this.drawFeature(C)
}}},addFeatures:function(B,I){if(!(B instanceof Array)){B=[B]
}var G=!I||!I.silent;
if(G){var A={features:B};
var F=this.events.triggerEvent("beforefeaturesadded",A);
if(F===false){return 
}B=A.features
}for(var C=0,E=B.length;
C<E;
C++){if(C!=(B.length-1)){this.renderer.locked=true
}else{this.renderer.locked=false
}var H=B[C];
if(this.geometryType&&!(H.geometry instanceof this.geometryType)){var D=OpenLayers.i18n("componentShouldBe",{geomType:this.geometryType.prototype.CLASS_NAME});
throw D
}this.features.push(H);
H.layer=this;
if(!H.style&&this.style){H.style=OpenLayers.Util.extend({},this.style)
}if(G){if(this.events.triggerEvent("beforefeatureadded",{feature:H})===false){continue
}this.preFeatureInsert(H)
}if(this.drawn){this.drawFeature(H)
}if(G){this.events.triggerEvent("featureadded",{feature:H});
this.onFeatureInsert(H)
}}if(G){this.events.triggerEvent("featuresadded",{features:B})
}},removeFeatures:function(E,A){if(!E||E.length===0){return 
}if(!(E instanceof Array)){E=[E]
}var D=!A||!A.silent;
for(var C=E.length-1;
C>=0;
C--){if(C!=0&&E[C-1].geometry){this.renderer.locked=true
}else{this.renderer.locked=false
}var B=E[C];
delete this.unrenderedFeatures[B.id];
if(D){this.events.triggerEvent("beforefeatureremoved",{feature:B})
}this.features=OpenLayers.Util.removeItem(this.features,B);
B.layer=null;
if(B.geometry){this.renderer.eraseGeometry(B.geometry)
}if(OpenLayers.Util.indexOf(this.selectedFeatures,B)!=-1){OpenLayers.Util.removeItem(this.selectedFeatures,B)
}if(D){this.events.triggerEvent("featureremoved",{feature:B})
}}if(D){this.events.triggerEvent("featuresremoved",{features:E})
}},destroyFeatures:function(D,A){var C=(D==undefined);
if(C){D=this.features
}if(D){this.removeFeatures(D,A);
for(var B=D.length-1;
B>=0;
B--){D[B].destroy()
}}},drawFeature:function(A,B){if(typeof B!="object"){var C=typeof B=="string"?B:A.renderIntent;
B=A.style||this.style;
if(!B){B=this.styleMap.createSymbolizer(A,C)
}}if(!this.renderer.drawFeature(A,B)){this.unrenderedFeatures[A.id]=A
}else{delete this.unrenderedFeatures[A.id]
}},eraseFeatures:function(A){this.renderer.eraseFeatures(A)
},getFeatureFromEvent:function(A){if(!this.renderer){OpenLayers.Console.error(OpenLayers.i18n("getFeatureError"));
return null
}var B=this.renderer.getFeatureIdFromEvent(A);
return this.getFeatureById(B)
},getFeatureById:function(D){var C=null;
for(var B=0,A=this.features.length;
B<A;
++B){if(this.features[B].id==D){C=this.features[B];
break
}}return C
},onFeatureInsert:function(A){},preFeatureInsert:function(A){},getDataExtent:function(){var B=null;
if(this.features&&(this.features.length>0)){var B=this.features[0].geometry.getBounds();
for(var C=0,A=this.features.length;
C<A;
C++){B.extend(this.features[C].geometry.getBounds())
}}return B
},CLASS_NAME:"OpenLayers.Layer.Vector"});OpenLayers.Protocol=OpenLayers.Class({format:null,options:null,autoDestroy:true,initialize:function(A){A=A||{};
OpenLayers.Util.extend(this,A);
this.options=A
},destroy:function(){this.options=null;
this.format=null
},read:function(){},create:function(){},update:function(){},"delete":function(){},commit:function(){},CLASS_NAME:"OpenLayers.Protocol"});
OpenLayers.Protocol.Response=OpenLayers.Class({code:null,requestType:null,last:true,features:null,reqFeatures:null,priv:null,initialize:function(A){OpenLayers.Util.extend(this,A)
},success:function(){return this.code>0
},CLASS_NAME:"OpenLayers.Protocol.Response"});
OpenLayers.Protocol.Response.SUCCESS=1;
OpenLayers.Protocol.Response.FAILURE=0;OpenLayers.Protocol.HTTP=OpenLayers.Class(OpenLayers.Protocol,{url:null,headers:null,params:null,callback:null,scope:null,initialize:function(A){this.params={};
this.headers={};
OpenLayers.Protocol.prototype.initialize.apply(this,arguments)
},destroy:function(){this.params=null;
this.headers=null;
OpenLayers.Protocol.prototype.destroy.apply(this)
},createCallback:function(C,A,B){return OpenLayers.Function.bind(function(){C.apply(this,[A,B])
},this)
},read:function(A){A=OpenLayers.Util.applyDefaults(A,this.options);
var B=new OpenLayers.Protocol.Response({requestType:"read"});
if(A.filter&&A.filter instanceof OpenLayers.Filter.Spatial){if(A.filter.type==OpenLayers.Filter.Spatial.BBOX){A.params=OpenLayers.Util.extend(A.params,{bbox:A.filter.value.toArray()})
}}B.priv=OpenLayers.Request.GET({url:A.url,callback:this.createCallback(this.handleRead,B,A),params:A.params,headers:A.headers});
return B
},handleRead:function(B,A){this.handleResponse(B,A)
},create:function(B,A){A=OpenLayers.Util.applyDefaults(A,this.options);
var C=new OpenLayers.Protocol.Response({reqFeatures:B,requestType:"create"});
C.priv=OpenLayers.Request.POST({url:A.url,callback:this.createCallback(this.handleCreate,C,A),headers:A.headers,data:this.format.write(B)});
return C
},handleCreate:function(B,A){this.handleResponse(B,A)
},update:function(C,B){var A=B.url||C.url||this.options.url;
B=OpenLayers.Util.applyDefaults(B,this.options);
var D=new OpenLayers.Protocol.Response({reqFeatures:C,requestType:"update"});
D.priv=OpenLayers.Request.PUT({url:A,callback:this.createCallback(this.handleUpdate,D,B),headers:B.headers,data:this.format.write(C)});
return D
},handleUpdate:function(B,A){this.handleResponse(B,A)
},"delete":function(C,B){var A=B.url||C.url||this.options.url;
B=OpenLayers.Util.applyDefaults(B,this.options);
var D=new OpenLayers.Protocol.Response({reqFeatures:C,requestType:"delete"});
D.priv=OpenLayers.Request.DELETE({url:A,callback:this.createCallback(this.handleDelete,D,B),headers:B.headers});
return D
},handleDelete:function(B,A){this.handleResponse(B,A)
},handleResponse:function(C,A){var B=C.priv;
if(A.callback){if(B.status>=200&&B.status<300){if(C.requestType!="delete"){C.features=this.parseFeatures(B)
}C.code=OpenLayers.Protocol.Response.SUCCESS
}else{C.code=OpenLayers.Protocol.Response.FAILURE
}A.callback.call(A.scope,C)
}},parseFeatures:function(A){var B=A.responseXML;
if(!B||!B.documentElement){B=A.responseText
}if(!B||B.length<=0){return null
}return this.format.read(B)
},commit:function(A,L){L=OpenLayers.Util.applyDefaults(L,this.options);
var B=[],I=0;
var G={};
G[OpenLayers.State.INSERT]=[];
G[OpenLayers.State.UPDATE]=[];
G[OpenLayers.State.DELETE]=[];
var K,H;
for(var C=0,F=A.length;
C<F;
++C){K=A[C];
H=G[K.state];
if(H){H.push(K)
}}var E=(G[OpenLayers.State.INSERT].length>0?1:0)+G[OpenLayers.State.UPDATE].length+G[OpenLayers.State.DELETE].length;
function J(M){I++;
M.last=(I>=E);
this.callUserCallback(M,L)
}var D=G[OpenLayers.State.INSERT];
if(D.length>0){B.push(this.create(D,OpenLayers.Util.applyDefaults({callback:J,scope:this},L.create||{})))
}D=G[OpenLayers.State.UPDATE];
for(var C=D.length-1;
C>=0;
--C){B.push(this.update(D[C],OpenLayers.Util.applyDefaults({callback:J,scope:this},L.update||{})))
}D=G[OpenLayers.State.DELETE];
for(var C=D.length-1;
C>=0;
--C){B.push(this["delete"](D[C],OpenLayers.Util.applyDefaults({callback:J,scope:this},L["delete"]||{})))
}return B
},callUserCallback:function(C,A){var B=A[C.requestType];
if(B&&B.callback){B.callback.call(B.scope,C)
}if(C.last&&A.callback){A.callback.call(A.scope)
}},CLASS_NAME:"OpenLayers.Protocol.HTTP"});OpenLayers.Layer.PointTrack=OpenLayers.Class(OpenLayers.Layer.Vector,{dataFrom:null,initialize:function(B,A){OpenLayers.Layer.Vector.prototype.initialize.apply(this,arguments)
},addNodes:function(F){if(F.length<2){OpenLayers.Console.error("At least two point features have to be added to createa line from");
return 
}var J=new Array(F.length-1);
var G,A,H;
for(var C=0,E=F.length;
C<E;
C++){G=F[C];
H=G.geometry;
if(!H){var D=G.lonlat;
H=new OpenLayers.Geometry.Point(D.lon,D.lat)
}else{if(H.CLASS_NAME!="OpenLayers.Geometry.Point"){OpenLayers.Console.error("Only features with point geometries are supported.");
return 
}}if(C>0){var B=(this.dataFrom!=null)?(F[C+this.dataFrom].data||F[C+this.dataFrom].attributes):null;
var I=new OpenLayers.Geometry.LineString([A,H]);
J[C-1]=new OpenLayers.Feature.Vector(I,B)
}A=H
}this.addFeatures(J)
},CLASS_NAME:"OpenLayers.Layer.PointTrack"});
OpenLayers.Layer.PointTrack.dataFrom={SOURCE_NODE:-1,TARGET_NODE:0};OpenLayers.Style=OpenLayers.Class({name:null,title:null,description:null,layerName:null,isDefault:false,rules:null,context:null,defaultStyle:null,propertyStyles:null,initialize:function(B,A){this.rules=[];
this.setDefaultStyle(B||OpenLayers.Feature.Vector.style["default"]);
OpenLayers.Util.extend(this,A)
},destroy:function(){for(var B=0,A=this.rules.length;
B<A;
B++){this.rules[B].destroy();
this.rules[B]=null
}this.rules=null;
this.defaultStyle=null
},createSymbolizer:function(J){var A=this.createLiterals(OpenLayers.Util.extend({},this.defaultStyle),J);
var I=this.rules;
var H,B;
var C=[];
var F=false;
for(var D=0,E=I.length;
D<E;
D++){H=I[D];
var G=H.evaluate(J);
if(G){if(H instanceof OpenLayers.Rule&&H.elseFilter){C.push(H)
}else{F=true;
this.applySymbolizer(H,A,J)
}}}if(F==false&&C.length>0){F=true;
for(var D=0,E=C.length;
D<E;
D++){this.applySymbolizer(C[D],A,J)
}}if(I.length>0&&F==false){A.display="none"
}else{A.display=""
}return A
},applySymbolizer:function(E,D,B){var A=B.geometry?this.getSymbolizerPrefix(B.geometry):OpenLayers.Style.SYMBOLIZER_PREFIXES[0];
var C=E.symbolizer[A]||E.symbolizer;
return this.createLiterals(OpenLayers.Util.extend(D,C),B)
},createLiterals:function(D,C){var B=this.context||C.attributes||C.data;
for(var A in this.propertyStyles){D[A]=OpenLayers.Style.createLiteral(D[A],B,C)
}return D
},findPropertyStyles:function(){var D={};
var F=this.defaultStyle;
this.addPropertyStyles(D,F);
var H=this.rules;
var E,G;
for(var C=0,A=H.length;
C<A;
C++){var E=H[C].symbolizer;
for(var B in E){G=E[B];
if(typeof G=="object"){this.addPropertyStyles(D,G)
}else{this.addPropertyStyles(D,E);
break
}}}return D
},addPropertyStyles:function(B,C){var D;
for(var A in C){D=C[A];
if(typeof D=="string"&&D.match(/\$\{\w+\}/)){B[A]=true
}}return B
},addRules:function(A){this.rules=this.rules.concat(A);
this.propertyStyles=this.findPropertyStyles()
},setDefaultStyle:function(A){this.defaultStyle=A;
this.propertyStyles=this.findPropertyStyles()
},getSymbolizerPrefix:function(D){var C=OpenLayers.Style.SYMBOLIZER_PREFIXES;
for(var B=0,A=C.length;
B<A;
B++){if(D.CLASS_NAME.indexOf(C[B])!=-1){return C[B]
}}},CLASS_NAME:"OpenLayers.Style"});
OpenLayers.Style.createLiteral=function(C,B,A){if(typeof C=="string"&&C.indexOf("${")!=-1){C=OpenLayers.String.format(C,B,[A]);
C=(isNaN(C)||!C)?C:parseFloat(C)
}return C
};
OpenLayers.Style.SYMBOLIZER_PREFIXES=["Point","Line","Polygon","Text"];OpenLayers.StyleMap=OpenLayers.Class({styles:null,extendDefault:true,initialize:function(C,A){this.styles={"default":new OpenLayers.Style(OpenLayers.Feature.Vector.style["default"]),select:new OpenLayers.Style(OpenLayers.Feature.Vector.style.select),temporary:new OpenLayers.Style(OpenLayers.Feature.Vector.style.temporary)};
if(C instanceof OpenLayers.Style){this.styles["default"]=C;
this.styles.select=C;
this.styles.temporary=C
}else{if(typeof C=="object"){for(var B in C){if(C[B] instanceof OpenLayers.Style){this.styles[B]=C[B]
}else{if(typeof C[B]=="object"){this.styles[B]=new OpenLayers.Style(C[B])
}else{this.styles["default"]=new OpenLayers.Style(C);
this.styles.select=new OpenLayers.Style(C);
this.styles.temporary=new OpenLayers.Style(C);
break
}}}}}OpenLayers.Util.extend(this,A)
},destroy:function(){for(var A in this.styles){this.styles[A].destroy()
}this.styles=null
},createSymbolizer:function(B,C){if(!B){B=new OpenLayers.Feature.Vector()
}if(!this.styles[C]){C="default"
}B.renderIntent=C;
var A={};
if(this.extendDefault&&C!="default"){A=this.styles["default"].createSymbolizer(B)
}return OpenLayers.Util.extend(A,this.styles[C].createSymbolizer(B))
},addUniqueValueRules:function(B,D,F,A){var E=[];
for(var C in F){E.push(new OpenLayers.Rule({symbolizer:F[C],context:A,filter:new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.EQUAL_TO,property:D,value:C})}))
}this.styles[B].addRules(E)
},CLASS_NAME:"OpenLayers.StyleMap"});OpenLayers.Rule=OpenLayers.Class({id:null,name:"default",title:null,description:null,context:null,filter:null,elseFilter:false,symbolizer:null,minScaleDenominator:null,maxScaleDenominator:null,initialize:function(A){this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_");
this.symbolizer={};
OpenLayers.Util.extend(this,A)
},destroy:function(){for(var A in this.symbolizer){this.symbolizer[A]=null
}this.symbolizer=null
},evaluate:function(C){var B=this.getContext(C);
var A=true;
if(this.minScaleDenominator||this.maxScaleDenominator){var D=C.layer.map.getScale()
}if(this.minScaleDenominator){A=D>=OpenLayers.Style.createLiteral(this.minScaleDenominator,B)
}if(A&&this.maxScaleDenominator){A=D<OpenLayers.Style.createLiteral(this.maxScaleDenominator,B)
}if(A&&this.filter){if(this.filter.CLASS_NAME=="OpenLayers.Filter.FeatureId"){A=this.filter.evaluate(C)
}else{A=this.filter.evaluate(B)
}}return A
},getContext:function(B){var A=this.context;
if(!A){A=B.attributes||B.data
}if(typeof this.context=="function"){A=this.context(B)
}return A
},CLASS_NAME:"OpenLayers.Rule"});OpenLayers.Filter=OpenLayers.Class({initialize:function(A){OpenLayers.Util.extend(this,A)
},destroy:function(){},evaluate:function(A){return true
},CLASS_NAME:"OpenLayers.Filter"});OpenLayers.Filter.FeatureId=OpenLayers.Class(OpenLayers.Filter,{fids:null,initialize:function(A){this.fids=[];
OpenLayers.Filter.prototype.initialize.apply(this,[A])
},evaluate:function(C){for(var B=0,A=this.fids.length;
B<A;
B++){var D=C.fid||C.id;
if(D==this.fids[B]){return true
}}return false
},CLASS_NAME:"OpenLayers.Filter.FeatureId"});OpenLayers.Filter.Logical=OpenLayers.Class(OpenLayers.Filter,{filters:null,type:null,initialize:function(A){this.filters=[];
OpenLayers.Filter.prototype.initialize.apply(this,[A])
},destroy:function(){this.filters=null;
OpenLayers.Filter.prototype.destroy.apply(this)
},evaluate:function(C){switch(this.type){case OpenLayers.Filter.Logical.AND:for(var B=0,A=this.filters.length;
B<A;
B++){if(this.filters[B].evaluate(C)==false){return false
}}return true;
case OpenLayers.Filter.Logical.OR:for(var B=0,A=this.filters.length;
B<A;
B++){if(this.filters[B].evaluate(C)==true){return true
}}return false;
case OpenLayers.Filter.Logical.NOT:return(!this.filters[0].evaluate(C))
}},CLASS_NAME:"OpenLayers.Filter.Logical"});
OpenLayers.Filter.Logical.AND="&&";
OpenLayers.Filter.Logical.OR="||";
OpenLayers.Filter.Logical.NOT="!";OpenLayers.Filter.Comparison=OpenLayers.Class(OpenLayers.Filter,{type:null,property:null,value:null,lowerBoundary:null,upperBoundary:null,initialize:function(A){OpenLayers.Filter.prototype.initialize.apply(this,[A])
},evaluate:function(B){switch(this.type){case OpenLayers.Filter.Comparison.EQUAL_TO:case OpenLayers.Filter.Comparison.LESS_THAN:case OpenLayers.Filter.Comparison.GREATER_THAN:case OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO:case OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO:return this.binaryCompare(B,this.property,this.value);
case OpenLayers.Filter.Comparison.BETWEEN:var A=B[this.property]>=this.lowerBoundary;
A=A&&B[this.property]<=this.upperBoundary;
return A;
case OpenLayers.Filter.Comparison.LIKE:var C=new RegExp(this.value,"gi");
return C.test(B[this.property])
}},value2regex:function(D,B,A){if(D=="."){var C="'.' is an unsupported wildCard character for OpenLayers.Filter.Comparison";
OpenLayers.Console.error(C);
return null
}D=D?D:"*";
B=B?B:".";
A=A?A:"!";
this.value=this.value.replace(new RegExp("\\"+A+"(.|$)","g"),"\\$1");
this.value=this.value.replace(new RegExp("\\"+B,"g"),".");
this.value=this.value.replace(new RegExp("\\"+D,"g"),".*");
this.value=this.value.replace(new RegExp("\\\\.\\*","g"),"\\"+D);
this.value=this.value.replace(new RegExp("\\\\\\.","g"),"\\"+B);
return this.value
},regex2value:function(){var A=this.value;
A=A.replace(/!/g,"!!");
A=A.replace(/(\\)?\\\./g,function(C,B){return B?C:"!."
});
A=A.replace(/(\\)?\\\*/g,function(C,B){return B?C:"!*"
});
A=A.replace(/\\\\/g,"\\");
A=A.replace(/\.\*/g,"*");
return A
},binaryCompare:function(A,C,B){switch(this.type){case OpenLayers.Filter.Comparison.EQUAL_TO:return A[C]==B;
case OpenLayers.Filter.Comparison.NOT_EQUAL_TO:return A[C]!=B;
case OpenLayers.Filter.Comparison.LESS_THAN:return A[C]<B;
case OpenLayers.Filter.Comparison.GREATER_THAN:return A[C]>B;
case OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO:return A[C]<=B;
case OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO:return A[C]>=B
}},CLASS_NAME:"OpenLayers.Filter.Comparison"});
OpenLayers.Filter.Comparison.EQUAL_TO="==";
OpenLayers.Filter.Comparison.NOT_EQUAL_TO="!=";
OpenLayers.Filter.Comparison.LESS_THAN="<";
OpenLayers.Filter.Comparison.GREATER_THAN=">";
OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO="<=";
OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO=">=";
OpenLayers.Filter.Comparison.BETWEEN="..";
OpenLayers.Filter.Comparison.LIKE="~";OpenLayers.Filter.Spatial=OpenLayers.Class(OpenLayers.Filter,{type:null,property:null,value:null,distance:null,distanceUnits:null,initialize:function(A){OpenLayers.Filter.prototype.initialize.apply(this,[A])
},evaluate:function(C){var A=false;
switch(this.type){case OpenLayers.Filter.Spatial.BBOX:case OpenLayers.Filter.Spatial.INTERSECTS:if(C.geometry){var B=this.value;
if(this.value.CLASS_NAME=="OpenLayers.Bounds"){B=this.value.toGeometry()
}if(C.geometry.intersects(B)){A=true
}}break;
default:OpenLayers.Console.error(OpenLayers.i18n("filterEvaluateNotImplemented"));
break
}return A
},CLASS_NAME:"OpenLayers.Filter.Spatial"});
OpenLayers.Filter.Spatial.BBOX="BBOX";
OpenLayers.Filter.Spatial.INTERSECTS="INTERSECTS";
OpenLayers.Filter.Spatial.DWITHIN="DWITHIN";OpenLayers.Format=OpenLayers.Class({options:null,externalProjection:null,internalProjection:null,initialize:function(A){OpenLayers.Util.extend(this,A);
this.options=A
},destroy:function(){},read:function(A){OpenLayers.Console.userError(OpenLayers.i18n("readNotImplemented"))
},write:function(A){OpenLayers.Console.userError(OpenLayers.i18n("writeNotImplemented"))
},CLASS_NAME:"OpenLayers.Format"});OpenLayers.Format.WKT=OpenLayers.Class(OpenLayers.Format,{initialize:function(A){this.regExes={typeStr:/^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,spaces:/\s+/,parenComma:/\)\s*,\s*\(/,doubleParenComma:/\)\s*\)\s*,\s*\(\s*\(/,trimParens:/^\s*\(?(.*?)\)?\s*$/};
OpenLayers.Format.prototype.initialize.apply(this,[A])
},read:function(F){var E,D,H;
var G=this.regExes.typeStr.exec(F);
if(G){D=G[1].toLowerCase();
H=G[2];
if(this.parse[D]){E=this.parse[D].apply(this,[H])
}if(this.internalProjection&&this.externalProjection){if(E&&E.CLASS_NAME=="OpenLayers.Feature.Vector"){E.geometry.transform(this.externalProjection,this.internalProjection)
}else{if(E&&D!="geometrycollection"&&typeof E=="object"){for(var C=0,A=E.length;
C<A;
C++){var B=E[C];
B.geometry.transform(this.externalProjection,this.internalProjection)
}}}}}return E
},write:function(A){var F,I,H,D,B;
if(A.constructor==Array){F=A;
B=true
}else{F=[A];
B=false
}var C=[];
if(B){C.push("GEOMETRYCOLLECTION(")
}for(var E=0,G=F.length;
E<G;
++E){if(B&&E>0){C.push(",")
}I=F[E].geometry;
H=I.CLASS_NAME.split(".")[2].toLowerCase();
if(!this.extract[H]){return null
}if(this.internalProjection&&this.externalProjection){I=I.clone();
I.transform(this.internalProjection,this.externalProjection)
}D=this.extract[H].apply(this,[I]);
C.push(H.toUpperCase()+"("+D+")")
}if(B){C.push(")")
}return C.join("")
},extract:{point:function(A){return A.x+" "+A.y
},multipoint:function(C){var D=[];
for(var B=0,A=C.components.length;
B<A;
++B){D.push(this.extract.point.apply(this,[C.components[B]]))
}return D.join(",")
},linestring:function(B){var D=[];
for(var C=0,A=B.components.length;
C<A;
++C){D.push(this.extract.point.apply(this,[B.components[C]]))
}return D.join(",")
},multilinestring:function(C){var D=[];
for(var B=0,A=C.components.length;
B<A;
++B){D.push("("+this.extract.linestring.apply(this,[C.components[B]])+")")
}return D.join(",")
},polygon:function(C){var D=[];
for(var B=0,A=C.components.length;
B<A;
++B){D.push("("+this.extract.linestring.apply(this,[C.components[B]])+")")
}return D.join(",")
},multipolygon:function(D){var C=[];
for(var B=0,A=D.components.length;
B<A;
++B){C.push("("+this.extract.polygon.apply(this,[D.components[B]])+")")
}return C.join(",")
}},parse:{point:function(B){var A=OpenLayers.String.trim(B).split(this.regExes.spaces);
return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(A[0],A[1]))
},multipoint:function(E){var C=OpenLayers.String.trim(E).split(",");
var D=[];
for(var B=0,A=C.length;
B<A;
++B){D.push(this.parse.point.apply(this,[C[B]]).geometry)
}return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiPoint(D))
},linestring:function(E){var C=OpenLayers.String.trim(E).split(",");
var D=[];
for(var B=0,A=C.length;
B<A;
++B){D.push(this.parse.point.apply(this,[C[B]]).geometry)
}return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LineString(D))
},multilinestring:function(F){var C;
var B=OpenLayers.String.trim(F).split(this.regExes.parenComma);
var E=[];
for(var D=0,A=B.length;
D<A;
++D){C=B[D].replace(this.regExes.trimParens,"$1");
E.push(this.parse.linestring.apply(this,[C]).geometry)
}return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiLineString(E))
},polygon:function(H){var C,B,F;
var G=OpenLayers.String.trim(H).split(this.regExes.parenComma);
var E=[];
for(var D=0,A=G.length;
D<A;
++D){C=G[D].replace(this.regExes.trimParens,"$1");
B=this.parse.linestring.apply(this,[C]).geometry;
F=new OpenLayers.Geometry.LinearRing(B.components);
E.push(F)
}return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon(E))
},multipolygon:function(F){var D;
var B=OpenLayers.String.trim(F).split(this.regExes.doubleParenComma);
var E=[];
for(var C=0,A=B.length;
C<A;
++C){D=B[C].replace(this.regExes.trimParens,"$1");
E.push(this.parse.polygon.apply(this,[D]).geometry)
}return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiPolygon(E))
},geometrycollection:function(E){E=E.replace(/,\s*([A-Za-z])/g,"|$1");
var D=OpenLayers.String.trim(E).split("|");
var C=[];
for(var B=0,A=D.length;
B<A;
++B){C.push(OpenLayers.Format.WKT.prototype.read.apply(this,[D[B]]))
}return C
}},CLASS_NAME:"OpenLayers.Format.WKT"});OpenLayers.Control.MouseToolbar=OpenLayers.Class(OpenLayers.Control.MouseDefaults,{mode:null,buttons:null,direction:"vertical",buttonClicked:null,initialize:function(A,B){OpenLayers.Control.prototype.initialize.apply(this,arguments);
this.position=new OpenLayers.Pixel(OpenLayers.Control.MouseToolbar.X,OpenLayers.Control.MouseToolbar.Y);
if(A){this.position=A
}if(B){this.direction=B
}this.measureDivs=[]
},destroy:function(){for(var B in this.buttons){var A=this.buttons[B];
A.map=null;
A.events.destroy()
}OpenLayers.Control.MouseDefaults.prototype.destroy.apply(this,arguments)
},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);
OpenLayers.Control.MouseDefaults.prototype.draw.apply(this,arguments);
this.buttons={};
var B=new OpenLayers.Size(28,28);
var A=new OpenLayers.Pixel(OpenLayers.Control.MouseToolbar.X,0);
this._addButton("zoombox","drag-rectangle-off.png","drag-rectangle-on.png",A,B,"Shift->Drag to zoom to area");
A=A.add((this.direction=="vertical"?0:B.w),(this.direction=="vertical"?B.h:0));
this._addButton("pan","panning-hand-off.png","panning-hand-on.png",A,B,"Drag the map to pan.");
A=A.add((this.direction=="vertical"?0:B.w),(this.direction=="vertical"?B.h:0));
this.switchModeTo("pan");
return this.div
},_addButton:function(A,E,D,I,G,H){var F=OpenLayers.Util.getImagesLocation()+E;
var C=OpenLayers.Util.getImagesLocation()+D;
var B=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_MouseToolbar_"+A,I,G,F,"absolute");
this.div.appendChild(B);
B.imgLocation=F;
B.activeImgLocation=C;
B.events=new OpenLayers.Events(this,B,null,true);
B.events.on({mousedown:this.buttonDown,mouseup:this.buttonUp,dblclick:OpenLayers.Event.stop,scope:this});
B.action=A;
B.title=H;
B.alt=H;
B.map=this.map;
this.buttons[A]=B;
return B
},buttonDown:function(A){if(!OpenLayers.Event.isLeftClick(A)){return 
}this.buttonClicked=A.element.action;
OpenLayers.Event.stop(A)
},buttonUp:function(A){if(!OpenLayers.Event.isLeftClick(A)){return 
}if(this.buttonClicked!=null){if(this.buttonClicked==A.element.action){this.switchModeTo(A.element.action)
}OpenLayers.Event.stop(A);
this.buttonClicked=null
}},defaultDblClick:function(B){this.switchModeTo("pan");
this.performedDrag=false;
var A=this.map.getLonLatFromViewPortPx(B.xy);
this.map.setCenter(A,this.map.zoom+1);
OpenLayers.Event.stop(B);
return false
},defaultMouseDown:function(A){if(!OpenLayers.Event.isLeftClick(A)){return 
}this.mouseDragStart=A.xy.clone();
this.performedDrag=false;
this.startViaKeyboard=false;
if(A.shiftKey&&this.mode!="zoombox"){this.switchModeTo("zoombox");
this.startViaKeyboard=true
}else{if(A.altKey&&this.mode!="measure"){this.switchModeTo("measure")
}else{if(!this.mode){this.switchModeTo("pan")
}}}switch(this.mode){case"zoombox":this.map.div.style.cursor="crosshair";
this.zoomBox=OpenLayers.Util.createDiv("zoomBox",this.mouseDragStart,null,null,"absolute","2px solid red");
this.zoomBox.style.backgroundColor="white";
this.zoomBox.style.filter="alpha(opacity=50)";
this.zoomBox.style.opacity="0.50";
this.zoomBox.style.fontSize="1px";
this.zoomBox.style.zIndex=this.map.Z_INDEX_BASE.Popup-1;
this.map.viewPortDiv.appendChild(this.zoomBox);
this.performedDrag=true;
break;
case"measure":var C="";
if(this.measureStart){var B=this.map.getLonLatFromViewPortPx(this.mouseDragStart);
C=OpenLayers.Util.distVincenty(this.measureStart,B);
C=Math.round(C*100)/100;
C=C+"km";
this.measureStartBox=this.measureBox
}this.measureStart=this.map.getLonLatFromViewPortPx(this.mouseDragStart);
this.measureBox=OpenLayers.Util.createDiv(null,this.mouseDragStart.add(-2-parseInt(this.map.layerContainerDiv.style.left),-2-parseInt(this.map.layerContainerDiv.style.top)),null,null,"absolute");
this.measureBox.style.width="4px";
this.measureBox.style.height="4px";
this.measureBox.style.fontSize="1px";
this.measureBox.style.backgroundColor="red";
this.measureBox.style.zIndex=this.map.Z_INDEX_BASE.Popup-1;
this.map.layerContainerDiv.appendChild(this.measureBox);
if(C){this.measureBoxDistance=OpenLayers.Util.createDiv(null,this.mouseDragStart.add(-2-parseInt(this.map.layerContainerDiv.style.left),2-parseInt(this.map.layerContainerDiv.style.top)),null,null,"absolute");
this.measureBoxDistance.innerHTML=C;
this.measureBoxDistance.style.zIndex=this.map.Z_INDEX_BASE.Popup-1;
this.map.layerContainerDiv.appendChild(this.measureBoxDistance);
this.measureDivs.push(this.measureBoxDistance)
}this.measureBox.style.zIndex=this.map.Z_INDEX_BASE.Popup-1;
this.map.layerContainerDiv.appendChild(this.measureBox);
this.measureDivs.push(this.measureBox);
break;
default:this.map.div.style.cursor="move";
break
}document.onselectstart=function(){return false
};
OpenLayers.Event.stop(A)
},switchModeTo:function(C){if(C!=this.mode){if(this.mode&&this.buttons[this.mode]){OpenLayers.Util.modifyAlphaImageDiv(this.buttons[this.mode],null,null,null,this.buttons[this.mode].imgLocation)
}if(this.mode=="measure"&&C!="measure"){for(var B=0,A=this.measureDivs.length;
B<A;
B++){if(this.measureDivs[B]){this.map.layerContainerDiv.removeChild(this.measureDivs[B])
}}this.measureDivs=[];
this.measureStart=null
}this.mode=C;
if(this.buttons[C]){OpenLayers.Util.modifyAlphaImageDiv(this.buttons[C],null,null,null,this.buttons[C].activeImgLocation)
}switch(this.mode){case"zoombox":this.map.div.style.cursor="crosshair";
break;
default:this.map.div.style.cursor="";
break
}}},leaveMode:function(){this.switchModeTo("pan")
},defaultMouseMove:function(E){if(this.mouseDragStart!=null){switch(this.mode){case"zoombox":var D=Math.abs(this.mouseDragStart.x-E.xy.x);
var B=Math.abs(this.mouseDragStart.y-E.xy.y);
this.zoomBox.style.width=Math.max(1,D)+"px";
this.zoomBox.style.height=Math.max(1,B)+"px";
if(E.xy.x<this.mouseDragStart.x){this.zoomBox.style.left=E.xy.x+"px"
}if(E.xy.y<this.mouseDragStart.y){this.zoomBox.style.top=E.xy.y+"px"
}break;
default:var D=this.mouseDragStart.x-E.xy.x;
var B=this.mouseDragStart.y-E.xy.y;
var F=this.map.getSize();
var A=new OpenLayers.Pixel(F.w/2+D,F.h/2+B);
var C=this.map.getLonLatFromViewPortPx(A);
this.map.setCenter(C,null,true);
this.mouseDragStart=E.xy.clone()
}this.performedDrag=true
}},defaultMouseUp:function(A){if(!OpenLayers.Event.isLeftClick(A)){return 
}switch(this.mode){case"zoombox":this.zoomBoxEnd(A);
if(this.startViaKeyboard){this.leaveMode()
}break;
case"pan":if(this.performedDrag){this.map.setCenter(this.map.center)
}}document.onselectstart=null;
this.mouseDragStart=null;
this.map.div.style.cursor="default"
},defaultMouseOut:function(A){if(this.mouseDragStart!=null&&OpenLayers.Util.mouseLeft(A,this.map.div)){if(this.zoomBox){this.removeZoomBox();
if(this.startViaKeyboard){this.leaveMode()
}}this.mouseDragStart=null;
this.map.div.style.cursor="default"
}},defaultClick:function(A){if(this.performedDrag){this.performedDrag=false;
return false
}},CLASS_NAME:"OpenLayers.Control.MouseToolbar"});
OpenLayers.Control.MouseToolbar.X=6;
OpenLayers.Control.MouseToolbar.Y=300;OpenLayers.Control.NavToolbar=OpenLayers.Class(OpenLayers.Control.Panel,{initialize:function(A){OpenLayers.Control.Panel.prototype.initialize.apply(this,[A]);
this.addControls([new OpenLayers.Control.Navigation(),new OpenLayers.Control.ZoomBox()])
},draw:function(){var A=OpenLayers.Control.Panel.prototype.draw.apply(this,arguments);
this.activateControl(this.controls[0]);
return A
},CLASS_NAME:"OpenLayers.Control.NavToolbar"});OpenLayers.Control.PanPanel=OpenLayers.Class(OpenLayers.Control.Panel,{initialize:function(A){OpenLayers.Control.Panel.prototype.initialize.apply(this,[A]);
this.addControls([new OpenLayers.Control.Pan(OpenLayers.Control.Pan.NORTH),new OpenLayers.Control.Pan(OpenLayers.Control.Pan.SOUTH),new OpenLayers.Control.Pan(OpenLayers.Control.Pan.EAST),new OpenLayers.Control.Pan(OpenLayers.Control.Pan.WEST)])
},CLASS_NAME:"OpenLayers.Control.PanPanel"});OpenLayers.Control.Pan=OpenLayers.Class(OpenLayers.Control,{slideFactor:50,direction:null,type:OpenLayers.Control.TYPE_BUTTON,initialize:function(B,A){this.direction=B;
this.CLASS_NAME+=this.direction;
OpenLayers.Control.prototype.initialize.apply(this,[A])
},trigger:function(){switch(this.direction){case OpenLayers.Control.Pan.NORTH:this.map.pan(0,-this.slideFactor);
break;
case OpenLayers.Control.Pan.SOUTH:this.map.pan(0,this.slideFactor);
break;
case OpenLayers.Control.Pan.WEST:this.map.pan(-this.slideFactor,0);
break;
case OpenLayers.Control.Pan.EAST:this.map.pan(this.slideFactor,0);
break
}},CLASS_NAME:"OpenLayers.Control.Pan"});
OpenLayers.Control.Pan.NORTH="North";
OpenLayers.Control.Pan.SOUTH="South";
OpenLayers.Control.Pan.EAST="East";
OpenLayers.Control.Pan.WEST="West";OpenLayers.Control.ZoomIn=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_BUTTON,trigger:function(){this.map.zoomIn()
},CLASS_NAME:"OpenLayers.Control.ZoomIn"});OpenLayers.Control.ZoomOut=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_BUTTON,trigger:function(){this.map.zoomOut()
},CLASS_NAME:"OpenLayers.Control.ZoomOut"});OpenLayers.Control.ZoomPanel=OpenLayers.Class(OpenLayers.Control.Panel,{initialize:function(A){OpenLayers.Control.Panel.prototype.initialize.apply(this,[A]);
this.addControls([new OpenLayers.Control.ZoomIn(),new OpenLayers.Control.ZoomToMaxExtent(),new OpenLayers.Control.ZoomOut()])
},CLASS_NAME:"OpenLayers.Control.ZoomPanel"});OpenLayers.Control.EditingToolbar=OpenLayers.Class(OpenLayers.Control.Panel,{initialize:function(E,C){OpenLayers.Control.Panel.prototype.initialize.apply(this,[C]);
this.addControls([new OpenLayers.Control.Navigation()]);
var B=[new OpenLayers.Control.DrawFeature(E,OpenLayers.Handler.Point,{displayClass:"olControlDrawFeaturePoint"}),new OpenLayers.Control.DrawFeature(E,OpenLayers.Handler.Path,{displayClass:"olControlDrawFeaturePath"}),new OpenLayers.Control.DrawFeature(E,OpenLayers.Handler.Polygon,{displayClass:"olControlDrawFeaturePolygon"})];
for(var D=0,A=B.length;
D<A;
D++){B[D].featureAdded=function(F){F.state=OpenLayers.State.INSERT
}
}this.addControls(B)
},draw:function(){var A=OpenLayers.Control.Panel.prototype.draw.apply(this,arguments);
this.activateControl(this.controls[0]);
return A
},CLASS_NAME:"OpenLayers.Control.EditingToolbar"});OpenLayers.Lang={code:null,defaultCode:"en",getCode:function(){if(!OpenLayers.Lang.code){OpenLayers.Lang.setCode()
}return OpenLayers.Lang.code
},setCode:function(B){var D;
if(!B){B=(OpenLayers.Util.getBrowserName()=="msie")?navigator.userLanguage:navigator.language
}var C=B.split("-");
C[0]=C[0].toLowerCase();
if(typeof OpenLayers.Lang[C[0]]=="object"){D=C[0]
}if(C[1]){var A=C[0]+"-"+C[1].toUpperCase();
if(typeof OpenLayers.Lang[A]=="object"){D=A
}}if(!D){OpenLayers.Console.warn("Failed to find OpenLayers.Lang."+C.join("-")+" dictionary, falling back to default language");
D=OpenLayers.Lang.defaultCode
}OpenLayers.Lang.code=D
},translate:function(B,A){var D=OpenLayers.Lang[OpenLayers.Lang.getCode()];
var C=D[B];
if(!C){C=B
}if(A){C=OpenLayers.String.format(C,A)
}return C
}};
OpenLayers.i18n=OpenLayers.Lang.translate;OpenLayers.Lang.en={unhandledRequest:"Unhandled request return ${statusText}",permalink:"Permalink",overlays:"Overlays",baseLayer:"Base Layer",sameProjection:"The overview map only works when it is in the same projection as the main map",readNotImplemented:"Read not implemented.",writeNotImplemented:"Write not implemented.",noFID:"Can't update a feature for which there is no FID.",errorLoadingGML:"Error in loading GML file ${url}",browserNotSupported:"Your browser does not support vector rendering. Currently supported renderers are:\n${renderers}",componentShouldBe:"addFeatures : component should be an ${geomType}",getFeatureError:"getFeatureFromEvent called on layer with no renderer. This usually means you destroyed a layer, but not some handler which is associated with it.",minZoomLevelError:"The minZoomLevel property is only intended for use with the FixedZoomLevels-descendent layers. That this wfs layer checks for minZoomLevel is a relic of thepast. We cannot, however, remove it without possibly breaking OL based applications that may depend on it. Therefore we are deprecating it -- the minZoomLevel check below will be removed at 3.0. Please instead use min/max resolution setting as described here: http://trac.openlayers.org/wiki/SettingZoomLevels",commitSuccess:"WFS Transaction: SUCCESS ${response}",commitFailed:"WFS Transaction: FAILED ${response}",googleWarning:"The Google Layer was unable to load correctly.<br><br>To get rid of this message, select a new BaseLayer in the layer switcher in the upper-right corner.<br><br>Most likely, this is because the Google Maps library script was either not included, or does not contain the correct API key for your site.<br><br>Developers: For help getting this working correctly, <a href='http://trac.openlayers.org/wiki/Google' target='_blank'>click here</a>",getLayerWarning:"The ${layerType} Layer was unable to load correctly.<br><br>To get rid of this message, select a new BaseLayer in the layer switcher in the upper-right corner.<br><br>Most likely, this is because the ${layerLib} library script was not correctly included.<br><br>Developers: For help getting this working correctly, <a href='http://trac.openlayers.org/wiki/${layerLib}' target='_blank'>click here</a>",scale:"Scale = 1 : ${scaleDenom}",layerAlreadyAdded:"You tried to add the layer: ${layerName} to the map, but it has already been added",reprojectDeprecated:"You are using the 'reproject' option on the ${layerName} layer. This option is deprecated: its use was designed to support displaying data over commercial basemaps, but that functionality should now be achieved by using Spherical Mercator support. More information is available from http://trac.openlayers.org/wiki/SphericalMercator.",methodDeprecated:"This method has been deprecated and will be removed in 3.0. Please use ${newMethod} instead.",boundsAddError:"You must pass both x and y values to the add function.",lonlatAddError:"You must pass both lon and lat values to the add function.",pixelAddError:"You must pass both x and y values to the add function.",unsupportedGeometryType:"Unsupported geometry type: ${geomType}",pagePositionFailed:"OpenLayers.Util.pagePosition failed: element with id ${elemId} may be misplaced.",end:"",filterEvaluateNotImplemented:"evaluate is not implemented for this filter type."};(function(A){A.fn.extend({fadedhint:function(){this.each(function(){var C=A(this),B=C.val();
C.focus(function(){if(C.val()===B){C.val("").removeClass("faded")
}});
C.blur(function(){if(C.val()===""){C.val(B).addClass("faded")
}})
}).addClass("faded");
return this
}})
})(jQuery);$.noConflict();
(function($) {sMap={SESSION_TIME:1800000,sessionUpdateInterval:null,funcQueue:[],getPositionBlocks:function(){var G=566,F=256;
var H=24,C=15;
var D=10;
var B=D+(H/2);
var J={offset:new OpenLayers.Pixel(-B,0),padding:new OpenLayers.Bounds(10,10,10,D*2),blocks:[{size:new OpenLayers.Size("auto","auto"),anchor:new OpenLayers.Bounds(0,D,D,D+1),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(D,"auto"),anchor:new OpenLayers.Bounds(null,D,0,D+1),position:new OpenLayers.Pixel(-556,0)},{size:new OpenLayers.Size("auto",D),anchor:new OpenLayers.Bounds(0,0,D,null),position:new OpenLayers.Pixel(0,-247)},{size:new OpenLayers.Size(D,D),anchor:new OpenLayers.Bounds(null,0,0,null),position:new OpenLayers.Pixel(-556,-247)},{size:new OpenLayers.Size(24,15),anchor:new OpenLayers.Bounds(D,null,null,0),position:new OpenLayers.Pixel(-35,-265)}]};
var A={offset:new OpenLayers.Pixel(B,0),padding:new OpenLayers.Bounds(10,10,10,D*2),blocks:[{size:new OpenLayers.Size("auto","auto"),anchor:new OpenLayers.Bounds(0,D,D,D+1),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(D,"auto"),anchor:new OpenLayers.Bounds(null,D,0,D+1),position:new OpenLayers.Pixel(-556,0)},{size:new OpenLayers.Size("auto",D),anchor:new OpenLayers.Bounds(0,0,D,null),position:new OpenLayers.Pixel(0,-247)},{size:new OpenLayers.Size(D,D),anchor:new OpenLayers.Bounds(null,0,0,null),position:new OpenLayers.Pixel(-556,-247)},{size:new OpenLayers.Size(24,15),anchor:new OpenLayers.Bounds(null,null,D,0),position:new OpenLayers.Pixel(-35,-265)}]};
var E={offset:new OpenLayers.Pixel(-B,0),padding:new OpenLayers.Bounds(10,D*2,10,10),blocks:[{size:new OpenLayers.Size("auto","auto"),anchor:new OpenLayers.Bounds(0,D*2,D,0),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(D,"auto"),anchor:new OpenLayers.Bounds(null,D*2,0,0),position:new OpenLayers.Pixel(-556,0)},{size:new OpenLayers.Size("auto",D),anchor:new OpenLayers.Bounds(0,D+1,D,null),position:new OpenLayers.Pixel(0,-247)},{size:new OpenLayers.Size(D,D),anchor:new OpenLayers.Bounds(null,D+1,0,null),position:new OpenLayers.Pixel(-556,-247)},{size:new OpenLayers.Size(24,15),anchor:new OpenLayers.Bounds(D,0,null,null),position:new OpenLayers.Pixel(-6,-263)}]};
var I={offset:new OpenLayers.Pixel(B,0),padding:new OpenLayers.Bounds(10,D*2,10,10),blocks:[{size:new OpenLayers.Size("auto","auto"),anchor:new OpenLayers.Bounds(0,D*2,D,0),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(D,"auto"),anchor:new OpenLayers.Bounds(null,D*2,0,0),position:new OpenLayers.Pixel(-556,0)},{size:new OpenLayers.Size("auto",D),anchor:new OpenLayers.Bounds(0,D+1,D,null),position:new OpenLayers.Pixel(0,-247)},{size:new OpenLayers.Size(D,D),anchor:new OpenLayers.Bounds(null,D+1,0,null),position:new OpenLayers.Pixel(-556,-247)},{size:new OpenLayers.Size(24,15),anchor:new OpenLayers.Bounds(null,0,D,null),position:new OpenLayers.Pixel(-6,-263)}]};
positionBlocks={tl:I,tr:E,bl:A,br:J};
return positionBlocks
},constructCallout:function(H,A,D,G,C,F,E){var B=new OpenLayers.Popup.FramedCloud(H,A,D,G,C,F,E);
B.imageSrc=sMap.url("/img/bubble.png");
B.imageSize=new OpenLayers.Size(566,287);
B.positionBlocks=sMap.getPositionBlocks();
B.isAlphaImage=true;
B.adjustClosePos.right=-4;
B.maxSize=new OpenLayers.Size(400,250);
return B
},getViewCenterPoint:function(){return sMap.map.getCenter()
},getTime:function(F,A,B){if(A!="mi"){var C=OpenLayers.INCHES_PER_UNIT[A]/OpenLayers.INCHES_PER_UNIT.mi;
F=F*C
}var D=F/B;
if(D<1){return Math.round(D*60)+"min"
}else{var E=Math.floor(D)+"h";
if(Math.round((D%1)*60)>0){E+="&nbsp;"+Math.round((D%1)*60)+"min"
}return E
}},getMetricDistance:function(A){if(this.map.units=="m"){A/=1000
}return this.formatOneDp(A)
},getImperialDistance:function(B){var A=0.621371192;
return this.formatOneDp(this.getMetricDistance(B)*A)
},getCyclingTime:function(B,A){return sMap.getTime(B,A,sMap.constants.cyclingMph)
},getWalkingTime:function(B,A){return sMap.getTime(B,A,sMap.constants.walkingMph)
},url:function(A){return sMap.constants.webappUrl+A
},imc:function(B){if(!sMap.drawingControl.drawing){var C=sMap.map.getLonLatFromPixel(sMap.mousePosition);
sMap.showCallout(C,"Loading...");
var A=this.id.split("."),D=A[0]+"."+A[1];
sMap.srv.loadCalloutContentWithFid(D,function(E){sMap.showCallout(C,E)
})
}return false
},select:function(A,E,C,B){function D(F){function G(){sMap.srv.loadCalloutContent(A,E,function(H){sMap.showCallout(F,H)
})
}if(B){G()
}else{sMap.srv.loadBounds(A,E,function(H){sMap.map.zoomToExtent(H);
G()
})
}}if(C){D(C)
}else{sMap.srv.loadCalloutPoint(A,E,D)
}if(A=="route"){sMap.highlightRoute(E)
}},highlightRoute:function(A){sMap.selectedRouteLayer.setSelected("route",A)
},showCallout:function(D,C,B){var A=sMap.constructCallout("viewCallout",D,new OpenLayers.Size(250,150),C,null,true,function(){this.destroy();
sMap.popupData=null;
if(B){B()
}});
while(sMap.map.popups&&sMap.map.popups.length){sMap.map.removePopup(sMap.map.popups[0])
}sMap.map.addPopup(A);
$(A.contentDiv).find("a.calloutLink").click(function(){var E=sMap.extractFeatureKeyFromHref(this.href)[1];
sMap.srv.findNearestRouteAccess(D,E,function(F){sMap.showCallout(D,F);
sMap.highlightRoute(E)
});
return false
});
sMap.popupData={lonlat:D,content:C}
},closeCallouts:function(){for(var A=0;
A<sMap.map.popups.length;
A++){sMap.map.removePopup(sMap.map.popups[A])
}},extractFeatureKeyFromHref:function(A){var B=A.replace(/%20/," ").replace(/%09/,"\t").split("#");
if(B[1]){return B[1].split("/")
}return[]
},formatOneDp:function(A){if(A==0){return"0"
}A=(Math.round(A*10)/10).toString();
return A
},createMapPageUrl:function(B,A){return A?sMap.substitute(sMap.constants.DOUBLE_FEATURE_MAP_PAGE,[B.layer,B.id,A.layer,A.id]):sMap.substitute(sMap.constants.SINGLE_FEATURE_MAP_PAGE,[B.layer,B.id])
},substitute:function(E,D){for(var C=0;
C<D.length;
C++){var B="%"+C+"%";
var A=E.indexOf(B);
E=E.substring(0,A)+D[C]+E.substring(A+B.length)
}return E
},initMap:function(E){OpenLayers.DOTS_PER_INCH=25.4/0.28;
OpenLayers.ImgPath=sMap.url("/img/");
var C=new OpenLayers.Bounds(-30000,0,700000,1220000);
var D=sMap.map=new OpenLayers.Map("smapOl",{controls:[],maxExtent:C,resolutions:[500,180,60,15,5,2,1],projection:"EPSG:27700",units:"m",paddingForPopups:new OpenLayers.Bounds(100,100,100,100),theme:null});
D.Z_INDEX_BASE.BaseLayer=D.Z_INDEX_BASE.Overlay;
D.events.register("mousemove",this,function(F){sMap.mousePosition=F.xy
});
D.addLayer(sMap.rasterLayer=new OpenLayers.Layer.WMS("Raster Layer",sMap.constants.backdropWmsUrl.split(","),{layers:sMap.constants.backdropWmsLayers.split(","),format:"image/jpeg"},{transitionEffect:"resize",isBaseLayer:false,resolutions:[5,2,1],delayTileDrawing:false,buffer:0}));
D.addLayer(sMap.vectorLayer=new sMap.ImageMapWMSLayer("Vector Layer",sMap.constants.featureWmsUrl.split(","),sMap.constants.featureImageMapWmsUrl,{layers:sMap.constants.featureWmsLayers.split(","),transparent:true},{attribution:"Dotted Eyes &copy; Crown copyright 2009. All rights reserved. Licence number 100019918",transitionEffect:"resize",isBaseLayer:true,delayTileDrawing:false,buffer:0}));
D.events.register("movestart",this,function(){sMap.moving=true;
sMap.vectorLayer.xhrQueueController.suspend()
});
D.events.register("moveend",this,function(){sMap.moving=false;
sMap.vectorLayer.xhrQueueController.resume();
sMap.runWhenReady()
});
function B(){var M,H,G,F,K=sMap.map.layers,I=K[K.length-1];
if(I.CLASS_NAME=="OpenLayers.Layer.WMS"){var L=0;
for(var J=0;
J<sMap.vectorLayer.grid.length;
J++){if(I.grid[J][J].bounds.toString()==sMap.vectorLayer.grid[0][0].bounds.toString()){L=J;
break
}}for(M=0;
M<sMap.vectorLayer.grid.length;
M++){F=I.grid[M+J];
G=sMap.vectorLayer.grid[M];
if(F){for(H=0;
H<G.length;
H++){if(F[H+J]){G[H].setTopTile(F[H+J])
}}}}}}D.events.register("addlayer",this,function(F){B()
});
D.events.register("moveend",this,function(){B()
});
sMap.selectedRouteLayer=new sMap.view.SelectedRouteLayer(D,["route","routesegment"]);
D.zoomToExtent(E?E:C);
var A=new OpenLayers.Control.KeyboardDefaults();
D.addControl(A);
D.sessionUpdateInterval=setInterval(sMap.updateMapSession.bind(this),sMap.SESSION_TIME/2);
return D
},initControls:function(F){F=F||{};
var T=sMap.map,G=$(T.div);
var J,K=10;
G.css("position","relative");
if(F.toolbar){var S=new sMap.HBox({allowSelection:true});
T.addControl(S);
var I=new sMap.Toolbar()
}var L=sMap.drawingLayer=new OpenLayers.Layer.Vector("Drawing Layer");
var M=sMap.drawingControl=new sMap.DrawingControl({layer:L,map:T,hideTool:!F.toolbar},I);
if(F.drawingControl){T.addControl(M)
}var Q=5;
if(F.toolbar){var N=S.build([new sMap.search.SearchControl({}),I,M]);
$(S.div).css("position","absolute").css("left",K).css("top",K);
var P=S.addFloatChild(1,"");
M.setStatus$div(P);
var R=new sMap.PrintControl(I.div);
T.addControl(R);
I.addControl("print",sMap.url("/img/printer.jpg"),"Print Map",function(){R.toggle()
});
var O=new sMap.HelpControl(sMap.constants.helpUrl,{allowSelection:true,size:new OpenLayers.Size(500,250),position:new OpenLayers.Pixel(120,55),title:"Using the interactive mapping"});
T.addControl(O);
var B=new sMap.SurveyControl(sMap.constants.surveyUrl,{allowSelection:true,size:new OpenLayers.Size(350,165),position:new OpenLayers.Pixel(190,95),title:"Sustrans survey"});
//T.addControl(B);
I.addControl("help",sMap.url("/img/help.jpg"),"Help",function(){O.toggle()
})
}if(F.attribution){var H=new OpenLayers.Control.Attribution({displayClass:"olControlAttribution"});
T.addControl(H);
$(H.div).css("position","absolute").css("right",0).css("bottom",0)
}if(F.panZoom){T.addControl(J=new OpenLayers.Control.PanZoomBar({zoomWorldIcon:true,location:new OpenLayers.Pixel(0,0)}));
T.addControl(new OpenLayers.Control.Navigation());
$(J.div).css("position","absolute").css("left",null).css("right",K+54).css("top",K)
}if(F.scaleBar){var D=new sMap.ScaleBar({});
T.addControl(D);
var E=jQuery(D.div);
E.css("position","absolute").css("left",K+Q).css("bottom",K+Q)
}if(F.legend){var C=new sMap.LegendControl(sMap.url("/img/legend.png"));
T.addControl(C);
$(C.div).css("position","absolute").css("right",K+C.WIDTH+Q).css("bottom",K+C.HEIGHT+Q)
}if(F.expand){var A=new sMap.ExpandMap();
T.addControl(A);
$(A.div).addClass("expand-control").css("position","absolute").css("left",K).css("top",K)
}},init:function(B){var A=sMap.initMap(B);
sMap.initControls({panZoom:true,attribution:true,scaleBar:true,legend:true,toolbar:true,progressBar:true,drawingControl:true});
sMap.nearyou.initialise();
sMap.userRouteManager.initialize()
},initSmall:function(B){var A=sMap.initMap(B);
sMap.initControls({panZoom:true,attribution:true,progressBar:true,expand:true})
},styleMap:{"measure-active":{strokeColor:"red",strokeWidth:8,strokeOpacity:0.5},measured:{strokeColor:"red",strokeWidth:8,strokeOpacity:0.5}},stateful:["drawingControl","selectedRouteLayer"],getMapState:function(){var B={};
B.popupData=sMap.popupData;
for(var A=0;
A<sMap.stateful.length;
A++){var C=sMap.stateful[A];
B[C]=sMap[C].saveState()
}return B
},setMapState:function(B){if(B.popupData){sMap.showCallout(B.popupData.lonlat,B.popupData.content)
}for(var A=0;
A<sMap.stateful.length;
A++){var C=sMap.stateful[A];
sMap[C].setState(B[C])
}},runWhenReady:function(A){if(A){if(A instanceof Function){sMap.funcQueue.push(A)
}}setTimeout(function(){if(!sMap.moving&&sMap.funcQueue.length){try{(sMap.funcQueue.shift())()
}catch(B){window.console&&console.error(B)
}if(sMap.funcQueue.length){setTimeout(function(){sMap.runWhenReady()
},0)
}}},0)
},isLoggedIn:function(){return this.userId!=null&&this.userId>0
},setUserId:function(A){this.userId=A;
if(sMap.map){sMap.userRouteManager.updateStatus()
}},updateMapSession:function(){if(this.isLoggedIn()){sMap.srv.updateMapSession()
}},_getKeyboardControl:function(){var B=this.map.getControlsByClass("OpenLayers.Control.KeyboardDefaults");
var A=null;
if(B.length==1){A=B[0]
}return A
},deactivateKeyboardControl:function(){var A=this._getKeyboardControl();
A.handler.deactivate()
},activateKeyboardControl:function(){var A=this._getKeyboardControl();
A.handler.activate()
}};sMap.userRouteManager={ROUTES_PER_PAGE:5,initialize:function(){var D=sMap.map.getControlsByClass("sMap.DrawingControl");
if(D.length==1){this.drawingControl=D[0]
}var A=jQuery("#route-results");
A.append("<div id='userroutes-results'><h3 class='title'/><div class='loading'><ul><li class='result last category'>Loading Results...</li></ul></div><div style='display: none;' class='status'/></div>");
A=jQuery("#userroutes-results");
A.children(".title").append('<a href="#">My routes</a>');
this.$loading=A.children("div.loading");
this.$results=A.children("div.status");
this.$pageNumbers=A.children("div.pageNumbers");
A.find(".title a").click(function(){this.show();
return false
}.bind(this));
var F=false;
if(window.location.hash){var C=window.location.hash.substring(1,window.location.hash.indexOf("/"));
if(C=="userroute"){var E=window.location.hash.substring(window.location.hash.indexOf("/")+1);
var B=E.split(",");
if(B[0]){E=B[0]
}sMap.srv.loadSharedRoute(E,function(H,I){if(I=="success"){if(H.username){var G=new OpenLayers.LonLat(B[1],B[2]);
var J=parseInt(B[3],10);
if(B[1]&&B[2]&&B[3]){this.viewSharedRoute(H,G,J)
}else{this.viewSharedRoute(H)
}}else{F=true
}}else{F=true
}if(F){alert("The user route requested is not valid or could not be found.\nPlease ensure that you are using the entire link.")
}}.bind(this))
}}if(sMap.isLoggedIn()){sMap.nearyou.hide();
sMap.nearyou.hide();
this.show();
this.loadRoutes()
}else{sMap.nearyou.show();
this.hide()
}sMap.map.events.register("moveend",this,this.updateShareUrl)
},updateShareUrl:function(){if(this.sharedRouteId){var A=window.location.protocol+"//"+window.location.host+window.location.pathname+"#userroute/"+this.sharedRouteId+","+sMap.map.getCenter().lon+","+sMap.map.getCenter().lat+","+sMap.map.getZoom();
this.$results.find("input#sharedroute_url").val(A)
}},show:function(){if(!sMap.isLoggedIn()||this.active){return 
}this.active=true;
sMap.nearyou.hide();
var A=jQuery("#route-results");
A.find("#userroutes-results div.status").show()
},hide:function(){this.active=false;
var A=jQuery("#route-results");
A.find("div.status").hide();
if(!sMap.isLoggedIn()){A.find("div#userroutes-results").hide()
}},loadRoutes:function(){if(!sMap.isLoggedIn()){return 
}jQuery("#userroutes-results").show();
sMap.srv.loadUserRoutes(function(A,B){if(B=="success"){if(A.length>0&&!A[A.length-1]){A.length--
}this.updateUserRoutes(A)
}else{this.updateUserRoutes(Array())
}}.bind(this))
},viewRoute:function(A){this.drawingControl.viewRoute(A)
},viewSharedRoute:function(B,A,C){this.drawingControl.viewSharedRoute(B,A,C)
},removeRoute:function(A){sMap.srv.deleteUserRoute(A,function(B,C){this.loadRoutes()
}.bind(this));
return true
},updateUserRoutes:function(K,H){this.routes=K;
this.pages=Math.ceil(this.routes.length/this.ROUTES_PER_PAGE);
this.currentPage=1;
if(H){if(H>1&&H<=this.pages){this.currentPage=parseInt(H,10)
}}this.$loading.hide();
this.$results.show();
var M=(this.currentPage-1)*this.ROUTES_PER_PAGE;
var B=(this.currentPage*this.ROUTES_PER_PAGE)-1;
if(B>this.routes.length-1){B=this.routes.length-1
}var F='<ul class="result">';
F+='<li class="category result last">';
F+='<ul class="category">';
for(var D=M;
D<(B+1);
D++){var I=this.routes[D];
F+='<li class="result'+(D==B?" last":"")+'">';
F+='<a href="#" id="viewroute_'+(D+1)+'" class="viewroute">'+I.name+"</a>";
F+='<ul class="actions">';
F+='<li><a href="#" id="hideroute_'+(D+1)+'" class="hideroute" style="display: none">(hide)</a></li>';
F+='<li><a href="#" id="shareroute_'+(D+1)+'" class="shareroute">(share)</a></li>';
F+='<li><a href="#" id="editroute_'+(D+1)+'" class="editroute">(edit)</a></li>';
F+='<li><a href="#" id="deleteroute_'+(D+1)+'" class="deleteroute">(delete)</a></li>';
F+="</ul>";
F+='<ul class="attributes"><li>Route length - '+sMap.getImperialDistance(I.routeLength*1000)+" miles ("+sMap.getMetricDistance(I.routeLength*1000)+" km)</li></ul>";
F+="</li>"
}F+="</ul></li></ul>";
if(K.length>0){this.$results.empty().append(F);
var L=function(N){this.removeActionContainers();
this.drawingControl.clearClick();
return false
}.bind(this);
this.$results.find("a.hideroute").click(L);
var E=function(N){this.removeActionContainers();
this.$results.find("a.hideroute").hide();
var P=N.target.id;
var O=P.substring(P.indexOf("_")+1)-1;
this.viewRoute(this.routes[O]);
this.$results.find("a#hideroute_"+(O+1)).show();
return false
}.bind(this);
this.$results.find("a.viewroute").click(E);
var G=function(N){this.removeActionContainers();
var P=N.target.id;
var O=$("#"+P);
var Q=P.substring(P.indexOf("_")+1);
this.$results.find("a#hideroute_"+Q).show();
O.parent().parent().after('<div id="sharecontainer_'+Q+'" class="sharecontainer"></div>');
var O=$("#sharecontainer_"+Q);
var R='<p>Copy this URL into a email/IM - </p><form><input id="sharedroute_url" class="shareroute_url" type="text" readonly="readonly" onfocus="this.select()"/></form>';
O.html(R);
this.sharedRouteId=this.routes[Q-1].id;
this.updateShareUrl();
this.updateSpacerHeight();
this.viewRoute(this.routes[Q-1]);
return false
}.bind(this);
this.$results.find("a.shareroute").click(G);
var A=function(N){this.removeActionContainers();
var P=N.target.id;
var O=P.substring(P.indexOf("_")+1)-1;
this.drawingControl.editRoute(this.routes[O]);
return false
}.bind(this);
this.$results.find("a.editroute").click(A);
var J=function(N){this.removeActionContainers();
var O=N.target.id;
var R=$("#"+O);
var Q=O.substring(O.indexOf("_")+1);
R.parent().parent().after('<div id="deletecontainer_'+Q+'" class="deletecontainer"></div>');
var R=$("#deletecontainer_"+Q);
R.html('<p>Are you sure? <a href="#" id="confirmdelete_'+Q+'" class="confirmdelete">Yes</a> or <a href="#" class="confirmdelete">No</a></p>');
var P=function(S){var U=S.target.id;
if(U){var T=U.substring(U.indexOf("_")+1)-1;
sMap.userRouteManager.removeRoute(this.routes[T].id);
if(this.drawingControl.routeId==this.routes[T].id){this.drawingControl.clearClick()
}}else{this.removeActionContainers()
}return false
}.bind(this);
R.find("a.confirmdelete").click(P);
this.updateSpacerHeight();
return false
}.bind(this);
this.$results.find("a.deleteroute").click(J)
}else{this.$results.empty().append('<div><ul><li class="result last category">Use the drawing tool to plot and save a journey here, you have space to save 45 routes.</li></ul>')
}var F='<div class="spacer"/><div class="pages"><small>Page</small> ';
for(var D=0;
D<this.pages;
D++){if(D+1!=this.currentPage){F+='<a href="#" id="pageNumber_'+(D+1)+'" class="pageNumber">'+(D+1)+"</a>"
}else{F+=D+1
}if(D<this.pages-1){F+=", "
}}F+="</div>";
this.$results.append("<div class='pageNumbers'/>");
$pageNumbers=this.$results.children("div.pageNumbers");
if(K.length>0){$pageNumbers.html(F);
var C=function(O){this.removeActionContainers();
var P=O.target.id;
var N=P.substring(P.indexOf("_")+1);
this.updateUserRoutes(this.routes,N);
return false
}.bind(this);
$pageNumbers.find("a.pageNumber").click(C)
}this.updateSpacerHeight()
},removeActionContainers:function(){this.sharedRouteId="";
this.$results.find(".confirmdelete").unbind("click");
this.$results.find(".deletecontainer").remove();
this.$results.find(".sharecontainer").remove();
this.$results.find("a.hideroute").hide();
this.updateSpacerHeight()
},updateSpacerHeight:function(){var A=0;
this.$results.find(".pageNumbers .spacer").css("height",A+"px");
var A=$("#route-results").height()-this.$results.height()-this.$results.find(".pageNumbers .pages").height()-54;
this.$results.find(".pageNumbers .spacer").css("height",A+"px")
},updateStatus:function(){if(sMap.isLoggedIn()){sMap.userRouteManager.active=false;
sMap.userRouteManager.loadRoutes();
sMap.userRouteManager.show();
jQuery("a#savesharedroute").show()
}else{sMap.nearyou.active=false;
sMap.nearyou.show();
jQuery("a#savesharedroute").hide()
}if(this.drawingControl.drawingComplete){this.drawingControl.updateTable("complete")
}}};sMap.DrawingControl=OpenLayers.Class(OpenLayers.Control,{ROUTE_COLOR:"#FF0000",ROUTE_OPACITY:0.5,MAXIMUM_ROUTE_DESCRIPTION_LENGTH:250,initialize:function(I,H){this.routeId="";
this.routeName="";
this.routeDescription="";
this.routeColor=this.ROUTE_COLOR;
this.routeOpacity=this.ROUTE_OPACITY;
I.displayClass="draw-panel";
OpenLayers.Control.prototype.initialize.apply(this,[I]);
this.toolbar=H;
var E=this;
var A={strokeColor:this.routeColor,strokeOpacity:this.routeOpacity,strokeWidth:6,fillColor:this.routeColor,pointRadius:2};
this.layer.styleMap=new OpenLayers.StyleMap(OpenLayers.Util.applyDefaults(A,OpenLayers.Feature.Vector.style["default"]));
var G={point:function(){E.pointModified(this.handler.line.geometry)
},done:function(K){this.drawFeature(K);
E.drawingDone(this.handler.line.geometry);
E.drawingTool.deactivate();
E.hoverTool.activate();
var J=E.drawingTool.layer.features[0];
E.editTool.selectControl.select(J);
E.hoverTool.trigger()
}};
this.drawingTool=new OpenLayers.Control.DrawFeature(this.layer,OpenLayers.Handler.Path,{handlerOptions:{freehandToggle:null,style:A,callbacks:G}});
this.editTool=new OpenLayers.Control.ModifyFeature(this.layer,{deleteCodes:[46]});
this.editTool.virtualStyle.strokeWidth=1;
this.editTool.virtualStyle.pointRadius=5;
this.editTool.virtualStyle.fillColor="#FFF";
this.editTool.realStyle.strokeWidth=1;
this.editTool.realStyle.pointRadius=5;
this.editTool.realStyle.fillOpacity=this.routeOpacity;
var B={onStart:function(K,J){if(K==this.editTool.vertices[0]||K==this.editTool.vertices[this.editTool.vertices.length-1]){this.editTool.dragControl.handlers.drag.mouseup({xy:J});
this.continueDrawing(K,J)
}else{this.editTool.dragStart.apply(this.editTool,[K,J])
}}.bind(this),onDrag:function(J){this.currentlyDrawing=true;
this.editTool.dragVertex.apply(this.editTool,[J])
}.bind(this),onComplete:function(J){this.currentlyDrawing=false;
this.editTool.dragComplete.apply(this.editTool,[J])
}.bind(this)};
this.editTool.dragControl.onStart=B.onStart;
this.editTool.dragControl.onDrag=B.onDrag;
this.editTool.dragControl.onComplete=B.onComplete;
var D=function(J){E.pointModified(J.feature.geometry,true);
this.hoverTool.trigger()
};
this.layer.events.register("featuremodified",this,D);
this.map.addControl(this.editTool);
this.hoverTool=new sMap.ModifyFeatureHoverControl(this.editTool);
this.map.addControl(this.hoverTool);
if(!I.hideTool){this.toolbar.addControl("draw",sMap.constants.webappUrl+"/img/pencil.jpg","Start drawing",function(){E.toggle()
})
}this.currentlyDrawing=false;
var F=new sMap.AutoPanControl(this,this.editTool);
var C={click:function(J){this.showRouteCallout(J,null,this.routeInfoTool.handlers.feature.evt.xy)
}.bind(this),clickout:function(){},over:function(){},out:function(){}};
this.routeInfoTool=new OpenLayers.Control.SelectFeature(this.layer,{callbacks:C});
this.map.addControl(this.routeInfoTool)
},continueDrawing:function(B,A){this.hoverTool.deactivate();
this.drawingTool.handler.drawing=true;
var C=this.drawingTool.layer.features[0].clone();
this.drawingTool.layer.removeFeatures(this.drawingTool.layer.features);
if(B.geometry.toString()==C.geometry.components[0].toString()){C.geometry.components.reverse()
}this.drawingTool.handler.line=C;
this.drawingTool.handler.point=B;
this.drawingTool.handler.lastDown=A;
this.drawingTool.handler.style.strokeColor=this.routeColor;
this.drawingTool.handler.style.strokeFill=this.routeColor;
this.drawingTool.handler.style.strokeOpacity=this.routeOpacity;
this.drawingTool.activate();
this.drawingTool.handler.drawFeature();
this.map.div.style.cursor="crosshair"
},toggle:function(){if(this.enabled){return 
}var A=!this.enabled;
this.enabled=A;
if(this.enabled){this.onClick()
}else{this.clearClick()
}this.updateToolbarIcon()
},updateToolbarIcon:function(){var A=$("#toolbar_draw");
if(A.length==1){if(!this.enabled){A[0].src=sMap.constants.webappUrl+"/img/pencil.jpg";
A[0].title="Start drawing";
A[0].parentNode.style.cursor="pointer"
}else{A[0].src=sMap.constants.webappUrl+"/img/pencil_off.jpg";
A[0].title="";
A[0].parentNode.style.cursor="default"
}}},onClick:function(){this.routeInfoTool.deactivate();
sMap.closeCallouts();
sMap.userRouteManager.removeActionContainers();
this.layer.destroyFeatures(this.layer.features);
this.activate();
this.drawingTool.activate();
jQuery(this.map.div).css("cursor","crosshair");
this.distance=0;
this.map.addLayer(this.layer);
this.updateTable("start");
this.currentlyDrawing=false;
this.drawingComplete=false;
this.routeSaved=false;
this.errors={};
this.editMode=false;
this.extraOptions=false;
this.routeId="";
this.routeName="";
this.routeDescription="";
this.routeColor=this.ROUTE_COLOR;
this.routeOpacity=this.ROUTE_OPACITY;
this.updateRouteStyle()
},clearClick:function(){this.routeInfoTool.deactivate();
sMap.closeCallouts();
this.enabled=false;
this.deactivate();
this.drawingTool.deactivate();
this.hoverTool.deactivate();
this.map.div.style.cursor="";
this.updateTable();
if(this.layer.features){this.layer.destroyFeatures(this.layer.features)
}this.$status.empty();
if(this.map.getLayer(this.layer.id)){this.map.removeLayer(this.layer)
}this.extraOptions=false;
this.currentlyDrawing=false;
this.drawingComplete=false;
this.updateToolbarIcon();
this.routeInfoTool.deactivate()
},drawingDone:function(A){this.currentlyDrawing=false;
this.map.div.style.cursor="";
this.updateTable("complete");
this.drawingComplete=true
},pointModified:function(B,A){if(!A){this.currentlyDrawing=true
}this.distance=B.getLength();
if(this.drawingComplete){this.updateTable("complete")
}else{this.updateTable("modify")
}},setStatus$div:function(B){this.$status=B;
function A(C){C.stopPropagation()
}this.$status.mousedown(A).click(A).dblclick(A)
},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);
if(this.hideTool){this.$status=$(this.div);
this.$status.css("background-color","white")
}this.updateTable();
this.map.addControl(this.drawingTool);
this.activate();
return this.div
},updateRouteStyle:function(C){var A={strokeColor:this.routeColor,strokeOpacity:this.routeOpacity,strokeWidth:6,fillColor:this.routeColor,pointRadius:2,title:this.routeName};
if(C){A.cursor="pointer"
}else{A.cursor="default"
}this.layer.styleMap=new OpenLayers.StyleMap(OpenLayers.Util.applyDefaults(A,OpenLayers.Feature.Vector.style["default"]));
this.editTool.virtualStyle.strokeColor=this.routeColor;
this.editTool.realStyle.strokeColor=this.routeColor;
this.editTool.realStyle.fillColor=this.routeColor;
this.editTool.realStyle.fillOpacity=this.routeOpacity;
this.hoverTool.setHoverColor(this.routeColor);
if(this.layer.features.length>0){var B=new OpenLayers.Feature.Vector(this.layer.features[0].geometry.clone());
B.style=A;
this.layer.destroyFeatures(this.layer.features);
this.layer.addFeatures([B]);
if(this.editTool.feature){this.editTool.selectControl.select(B)
}}},updateTable:function(E){function C(M){var N="";
N+='<form id="saveroute_form"><table><tr><th>Distance:</th><td colspan="3">'+sMap.getImperialDistance(M.distance)+" miles ("+sMap.getMetricDistance(M.distance)+'km)</td></tr><tr><th>Walk/Cycle:</th><td colspan="3">'+sMap.getWalkingTime(sMap.getImperialDistance(M.distance),"mi")+" / "+sMap.getCyclingTime(sMap.getImperialDistance(M.distance),"mi")+" (av)</td></tr>";
if(sMap.isLoggedIn()){N+='<tr><th>Name:</th><td colspan="3"><input id="userroutename" type="text" maxlength="30" /></td></tr>';
N+='<tr class="extraOptions"><th>Description:</th><td colspan="3"><textarea id="userroutedescription" rows="1"></textarea></td></tr>';
N+='<tr class="extraOptions"><th>Pick colour:<br />or</th><td colspan="3"><table class="presetColors"><tr>';
N+='<td id="presetColor1" class="presetColor">&nbsp;</td>';
N+='<td id="presetColor2" class="presetColor">&nbsp;</td>';
N+='<td id="presetColor3" class="presetColor">&nbsp;</td>';
N+='<td id="presetColor4" class="presetColor">&nbsp;</td>';
N+='<td id="presetColor5" class="presetColor">&nbsp;</td>';
N+="</tr></table></td></tr>";
N+='<tr class="extraOptions"><th>RGB value:</th><td><input type="text" id="userroutecolor" /></td>';
N+='<th>Opacity:</th><td><input type="text" id="userrouteopacity" /></td>';
N+="</tr>"
}N+="</table></form>";
return N
}if(this.$status){if(this.$status[this.$status.length-1].innerHTML==""){var B='<div class="draw-status"><div class="close"><a href="#"><img src="'+sMap.url("/img/close-button.gif")+'" title="close"/></a></div><div id="message">';
B+="</div></div>";
var H=$(B);
var L=this;
H.find("a").click(function(){L.clearClick();
return false
});
this.$status.html(H)
}var B="";
if(E=="start"){B+='<p class="instr">Click on the map to add points to the line.</p>';
if(!sMap.isLoggedIn()){B+='<p class="instr">Note that you will only be able to save and share your route if you are <a href="#" id="login_link">logged in</a>.</p>'
}}else{if(E=="modify"){B='<p class="instr">Click on the map to add points to the line.</p>';
B+='<p class="instr">Double click to finish drawing.</p>';
B+="<table><tr><th>Distance:</th><td>"+sMap.getImperialDistance(this.distance)+" miles ("+sMap.getMetricDistance(this.distance)+"km)</td></tr><tr><th>Walk/Cycle:</th><td>"+sMap.getWalkingTime(sMap.getImperialDistance(this.distance),"mi")+" / "+sMap.getCyclingTime(sMap.getImperialDistance(this.distance),"mi")+" (av)</td></tr>";
B+="</table>";
B+='<p class="instr">To pan the map press alt+shift+arrow.</p>'
}else{if(E=="complete"){if(!this.editMode){B='<p class="instr">Closing this window will clear the line.</p>'
}else{B='<p class="instr"><a id="help" href="#">Detailed editing instructions</a>.</p>'
}B+=C(this);
if(this.errors.routename){B+='<div class="error">You must enter a name for your route</div>'
}else{if(this.errors.server){B+='<div class="error">Sorry there was a problem saving your route and your route has not been saved.  Please wait a few minutes and try again.</div>'
}else{if(this.errors.quotaExceeded){B+='<div class="error">This route cannot be saved as you have reached your maximum, delete one from your My routes list to be able to save this route.</div>'
}}}if(this.errors.color){B+='<div class="error">You must enter a valid colour for your route</div>'
}if(this.errors.opacity){B+='<div class="error">You must enter a opacity value between 10% and 100%</div>'
}if(sMap.isLoggedIn()){B+='<table width="100%"><tr><td><a href="#" id="extraoptions">Add more detail</a></td>';
B+='<td align="right"><a href="#" id="saveroute">Save route</a></td></tr></table>'
}else{B+='<p class="instr">Only registered users can save and share their routes. Please <a href="#" id="login_link">register or log in</a>.</p>'
}}else{if(E=="saved"){if(this.errors.server){B=C(this);
B+='<div class="error">Sorry there was a problem saving your route and your route has not been saved.  Please wait a few minutes and try again.</div>'
}else{if(this.errors.quotaReached){B='<p class="instr">You have reached the account limit of 45 routes, if you want to add more routes please delete some of your old routes.</p>'
}else{B='<p class="instr">Your route was saved successfully as "'+this.routeName+'". To share, view, edit or delete your route, please select the relevant link in My routes.  To draw a new route, close this window and re-select the drawing tool.</p>'
}}}else{if(E=="updated"){if(this.errors.server){B=C(this);
B+='<div class="error">Sorry there was a problem saving your route and your route has not been saved.  Please wait a few minutes and try again.</div>'
}else{if(this.errors.quotaExceeded){B='<div class="error">This route cannot be saved as you have reached your maximum, delete one from your My routes list to be able to save this route.</div>'
}else{B='<p class="instr">Your route was updated successfully. To share, view, edit or delete your route, please select the relevant link in My routes.  To draw a new route, close this window and re-select the drawing tool.</p>'
}}}}}}}this.$status.find("#message").html(B);
this.extraOptions=!this.extraOptions;
this.toggleExtraOptions();
var L=this;
this.$status.find("#userroutename").val(this.routeName);
this.$status.find("#userroutedescription").val(this.routeDescription);
if(!this.routeColorFromForm){this.routeColorFromForm=this.routeColor;
this.routeColorFromForm=this.routeColorFromForm.substring(1)
}if(!this.routeOpacityFromForm){this.routeOpacityFromForm=this.routeOpacity
}this.$status.find("#userroutecolor").val(this.routeColorFromForm);
this.$status.find("#userrouteopacity").val((100*this.routeOpacityFromForm)+"%");
var I=Array();
I[0]="FF0000";
I[1]="007FFF";
I[2]="FFFF00";
I[3]="00EE00";
I[4]="FF00FF";
for(var F=0;
F<I.length;
F++){var G=L.$status.find("td#presetColor"+(F+1));
if(G.length>0){G[0].style.backgroundColor="#"+I[F]
}}this.colorChangeHandler=function(Q,M){if(M){var N=this.routeColor;
N=N.substring(1);
this.$status.find("input#userroutecolor").val(N)
}if(this.currentlyDrawing){return 
}var N=jQuery.trim(this.$status.find("input#userroutecolor").val());
var O=jQuery.trim(this.$status.find("input#userrouteopacity").val());
O=parseInt(O,10);
if(this.isValidColor(N)&&O>=10&&O<=100){this.routeColor="#"+N;
this.routeOpacity=O/100;
this.updateRouteStyle();
for(var P=0;
P<I.length;
P++){if(N==I[P]){this.$status.find("td#presetColor"+(P+1)).addClass("selected")
}else{this.$status.find("td#presetColor"+(P+1)).removeClass("selected")
}}}}.bind(this);
this.$status.find("input#userroutecolor").keyup(this.colorChangeHandler);
this.$status.find("input#userroutecolor").click(this.colorChangeHandler);
this.$status.find("input#userrouteopacity").keyup(this.colorChangeHandler);
this.$status.find("input#userrouteopacity").click(this.colorChangeHandler);
if(E=="complete"){this.colorChangeHandler(null,true)
}this.descriptionLimitHandler=function(){var M=this.$status.find("textarea#userroutedescription").val();
if(M.length>this.MAXIMUM_ROUTE_DESCRIPTION_LENGTH){M=M.substring(0,this.MAXIMUM_ROUTE_DESCRIPTION_LENGTH);
this.$status.find("textarea#userroutedescription").val(M)
}}.bind(this);
this.$status.find("textarea#userroutedescription").keyup(this.descriptionLimitHandler);
this.$status.find("textarea#userroutedescription").click(this.descriptionLimitHandler);
var K=function(N){if(this.currentlyDrawing){return 
}var M=N.target.id.substring(N.target.id.length-1);
this.$status.find("input#userroutecolor").val(I[M-1]);
this.colorChangeHandler()
}.bind(this);
this.$status.find("td.presetColor").click(K);
var D=function(){this.routeName=this.$status.find("#userroutename").val();
this.routeDescription=this.$status.find("#userroutedescription").val();
this.routeColorFromForm=this.$status.find("#userroutecolor").val();
this.routeOpacityFromForm=parseInt(this.$status.find("#userrouteopacity").val())/100;
this.saveUserRoute();
return false
}.bind(this);
this.$status.find("a#saveroute").click(D);
this.$status.find("form#saveroute_form").submit(D);
this.$status.find("a#help").click(function(){var M=this.layer.map.getControlsByClass("sMap.HelpControl");
M[0].showTopic("saveandshare");
return false
}.bind(this));
this.$status.find("a#extraoptions").click(function(){L.toggleExtraOptions();
return false
});
this.$status.find("a#login_link").click(function(){window.scrollTo(0,0);
$(".showLogin a").trigger("click");
return false
});
var J=function(){if(L.editTool.feature){L.editTool.selectControl.unselectAll()
}sMap.deactivateKeyboardControl()
};
var A=$(this.map.div);
A.find("input").focus(J);
A.find("textarea").focus(J);
A.find("input").blur(sMap.activateKeyboardControl.bind(sMap));
A.find("textarea").blur(sMap.activateKeyboardControl.bind(sMap))
}},isValidColor:function(A){if(A.length!=3&&A.length!=6){return false
}var B=A.match(/^[0-9A-Fa-f]+$/);
if(B==null){return false
}return true
},toggleExtraOptions:function(){this.extraOptions=!this.extraOptions;
if(this.extraOptions){this.$status.find("tr.extraOptions").show()
}else{this.$status.find("tr.extraOptions").hide()
}var A=this.$status.find("a#extraoptions");
A.attr("innerHTML",this.extraOptions?"Hide detail":"Add more detail")
},saveUserRoute:function(G){if(this.routeSaved){return false
}sMap.closeCallouts();
this.errors={};
if(!G){var F=$("#userroutename").val();
F=jQuery.trim(F);
var D=$("#userroutedescription").val();
D=jQuery.trim(D);
var C=$("#userroutecolor").val();
C=jQuery.trim(C);
var E=$("#userrouteopacity").val();
E=jQuery.trim(E);
E=parseInt(E,10)
}else{var F=this.routeName;
var D=this.routeDescription;
var C=this.routeColor;
C=C.substring(1);
var E=this.routeOpacity*100
}if(F==""){this.errors.routename=true
}else{if(F.length>30){this.errors.routename=true
}}if(D.length>250){D=D.substring(0,250)
}if(!this.isValidColor(C)){this.errors.color=true
}if(E<10||E>100){this.errors.opacity=true
}if(G||this.errors.routename||this.errors.description||this.errors.color||this.errors.opacity){this.updateTable("complete");
this.colorChangeHandler()
}else{this.routeName=F;
this.routeDescription=D;
this.routeColor=C;
this.routeOpacity=E/100;
var B=this.layer.features[0].geometry.toString();
var A=function(H,I){this.routeSaved=false;
this.errors={};
if(I=="success"){if(H.outcome=="WARN_MAX_ROUTES_REACHED"){this.errors.quotaReached=true;
sMap.userRouteManager.show();
sMap.userRouteManager.loadRoutes();
this.updateTable("saved")
}else{if(H.outcome=="FAILED_MAX_ROUTES_SAVED"){this.errors.quotaExceeded=true;
this.updateTable("complete")
}else{if(H.outcome=="SUCCESS_NEW"){sMap.userRouteManager.show();
sMap.userRouteManager.loadRoutes();
this.updateTable("saved")
}else{if(H.outcome=="SUCCESS_EDIT"){sMap.userRouteManager.show();
sMap.userRouteManager.loadRoutes();
this.updateTable("updated")
}else{this.errors.server=true;
this.updateTable("complete")
}}}}}else{this.errors.server=true;
this.updateTable("complete")
}}.bind(this);
if(!this.routeSaved){sMap.srv.saveUserRoute(this.routeId,this.routeName,this.routeDescription,this.routeColor,this.routeOpacity,B,A)
}this.routeSaved=true;
if(!this.errors.server){this.drawingTool.deactivate();
this.hoverTool.deactivate()
}}},viewSharedRoute:function(B,A,D){var C={username:B.username,center:A,zoom:D};
this.viewRoute(B,C)
},viewRoute:function(B,C){sMap.closeCallouts();
this.clearClick();
this.routeId=B.id;
var E=new OpenLayers.Format.WKT();
var D=E.read(B.route);
this.layer.addFeatures([D]);
this.map.addLayer(this.layer);
this.distance=D.geometry.getLength();
if(C){this.map.setCenter(C.center,C.zoom)
}else{var A=D.geometry.getBounds();
A=A.scale(1.3);
this.map.zoomToExtent(A)
}this.routeName=B.name;
this.routeDescription=B.description;
this.routeColor=B.color;
this.routeOpacity=B.opacity/100;
this.updateRouteStyle(true);
this.routeInfoTool.activate();
if(C&&C.username){this.showRouteCallout(D,C.username)
}else{this.showRouteCallout(D)
}},showRouteCallout:function(D,B,G){var A=D.geometry.components;
var H=D.geometry.getLength();
var F="<h3>"+this.routeName+"</h3>";
F+='<table class="route_summary">';
if(this.routeDescription){F+='<tr><td colspan="2">'+this.routeDescription+"</td></tr>"
}F+="<tr><th>Length:</th><td>"+sMap.getImperialDistance(H)+" miles ("+sMap.getMetricDistance(H)+"km)</td></tr>";
F+="<tr><th>Time to walk:</th><td>"+sMap.getWalkingTime(sMap.getImperialDistance(H),"mi")+"</td></tr>";
F+="<tr><th>Time to cycle:</th><td>"+sMap.getCyclingTime(sMap.getImperialDistance(H),"mi")+"</td></tr>";
var C=null;
if(B){F+='<tr><td colspan="2">';
F+='<a href="#" id="savesharedroute">Save to My Routes</a><br />';
F+="This route has been sent to you by "+B+"<br />";
F+='Important: by using this link you are deemed to accept these <a href="/mapterms" target="_blank">terms of use</a>. We have not checked this route and you must excercise your own judgement about whether and how to use it.';
F+="</td></tr>";
C=function(){this.clearClick();
jQuery("#savesharedroute").unbind("click");
return false
}.bind(this)
}F+="</table>";
var E=new OpenLayers.LonLat(A[0].x,A[0].y);
if(G){E=this.map.getLonLatFromViewPortPx(G)
}sMap.showCallout(E,F,C);
if(B&&!sMap.isLoggedIn()){jQuery("a#savesharedroute").hide()
}jQuery("#savesharedroute").click(function(){this.routeInfoTool.deactivate();
this.extaOptions=false;
this.routeColorFromForm=this.routeColor;
this.routeColorFromForm=this.routeColorFromForm.substring(1);
this.routeOpacityFromForm=this.routeOpacity;
this.toggleExtraOptions();
this.saveUserRoute(true);
return false
}.bind(this))
},editRoute:function(B){this.clearClick();
this.editMode=true;
this.drawingComplete=true;
var D=new OpenLayers.Format.WKT();
var C=D.read(B.route);
this.layer.addFeatures([C]);
this.map.addLayer(this.layer);
var A=C.geometry.getBounds();
A=A.scale(1.3);
this.map.zoomToExtent(A);
this.hoverTool.activate();
this.editTool.selectControl.select(C);
this.errors={};
this.routeName=B.name;
this.routeDescription=B.description;
this.routeId=B.id;
this.routeColor=B.color;
this.routeOpacity=B.opacity/100;
this.distance=C.geometry.getLength();
this.updateTable("complete");
this.colorChangeHandler(null,true);
this.enabled=true;
this.updateToolbarIcon();
this.updateRouteStyle();
this.extraOptions=false;
this.toggleExtraOptions()
},redraw:function(){},saveState:function(){var C=[];
var B=this.layer.features;
for(var A=0;
A<B.length;
A++){C.push(B[A].geometry.clone())
}return{geometries:C,imperialDistance:this.imperialDistance,metricDistance:this.metricDistance,distance:this.distance,routeColor:this.routeColor,routeOpacity:this.routeOpacity}
},setState:function(C){if(C.geometries){var D=[];
for(var B=0;
B<C.geometries.length;
B++){var A=new OpenLayers.Feature.Vector(C.geometries[B]);
D.push(A)
}this.layer.addFeatures(D);
this.map.addLayer(this.layer)
}this.distance=C.distance;
this.imperialDistance=C.imperialDistance;
this.metricDistance=C.metricDistance;
this.routeColor=C.routeColor;
this.routeOpacity=C.routeOpacity;
this.updateRouteStyle();
this.updateTable()
},CLASS_NAME:"sMap.DrawingControl"});sMap.ModifyFeatureHoverControl=OpenLayers.Class(OpenLayers.Control,{initialize:function(B,A){this.modifyFeatureControl=B;
OpenLayers.Control.prototype.initialize.apply(this,[A]);
this.handler=new OpenLayers.Handler.Hover(this,{move:this.trigger});
this.handler.pixelTolerance=1;
var C=OpenLayers.Util.extend({},this.modifyFeatureControl.style||this.modifyFeatureControl.layer.styleMap.createSymbolizer());
C.strokeWidth=1;
C.fillColor=C.strokeColor;
C.pointRadius=7;
this.hoverLayer=new OpenLayers.Layer.Vector("Hover Layer",{style:C})
},trigger:function(B){if(this.modifyFeatureControl.dragControl.handlers.drag.dragging){this.removeHighlights();
return 
}var A=this.modifyFeatureControl.dragControl.feature;
if(A!=null&&(OpenLayers.Util.indexOf(this.modifyFeatureControl.vertices,A)!=-1||OpenLayers.Util.indexOf(this.modifyFeatureControl.virtualVertices,A)!=-1)){if(!this.lastVertex||this.lastVertex.id!=A.id){this.hoverLayer.removeFeatures(this.hoverLayer.features,{silent:true});
this.hoverLayer.addFeatures([new OpenLayers.Feature.Vector(A.geometry.clone())])
}this.lastVertex=A
}else{this.removeHighlights()
}},removeHighlights:function(){if(this.hoverLayer.features.length>0){this.hoverLayer.removeFeatures(this.hoverLayer.features,{silent:true});
this.lastVertex=null
}},setHoverColor:function(A){this.hoverLayer.style.strokeColor=A;
this.hoverLayer.style.fillColor=A;
this.hoverLayer.redraw()
},activate:function(){if(this.active){return false
}this.modifyFeatureControl.map.addLayer(this.hoverLayer);
if(this.handler){this.handler.activate()
}this.active=true;
this.events.triggerEvent("activate");
this.modifyFeatureControl.activate();
return true
},deactivate:function(){if(this.active){this.modifyFeatureControl.map.removeLayer(this.hoverLayer);
if(this.handler){this.handler.deactivate()
}this.active=false;
this.events.triggerEvent("deactivate");
this.modifyFeatureControl.deactivate();
return true
}return false
}});sMap.AutoPanControl=OpenLayers.Class(OpenLayers.Control,{AUTO_PAN_TOLERANCE:20,AUTO_PAN_INTERVAL:1000,AUTO_PAN_STEP:100,EXTENDED_AUTO_PAN_STEP:200,EXTENDED_AUTO_PAN_DELAY:2000,ANIMATION_STEPS:50,initialize:function(C,B,A){this.map=C.map;
this.drawingControl=C;
this.modifyFeatureControl=B;
OpenLayers.Control.prototype.initialize.apply(this,[A]);
this.map.events.register("mousemove",this,this.mouseMove);
$(this.map.div).bind("mouseleave",this.stopPan.bind(this))
},mouseMove:function(A){if(!this.drawingControl.currentlyDrawing){return 
}this.direction=null;
var B=this.map.getSize();
var D=B.w-A.xy.x;
var C=B.h-A.xy.y;
if(D<=this.AUTO_PAN_TOLERANCE){this.direction="RIGHT";
this.startPan()
}else{if(D>=(B.w-this.AUTO_PAN_TOLERANCE)){this.direction="LEFT";
this.startPan()
}}if(C<=this.AUTO_PAN_TOLERANCE){this.direction="DOWN";
this.startPan()
}else{if(C>=(B.h-this.AUTO_PAN_TOLERANCE)){this.direction="UP";
this.startPan()
}}if(D>this.AUTO_PAN_TOLERANCE&&D<(B.w-this.AUTO_PAN_TOLERANCE)&&C>this.AUTO_PAN_TOLERANCE&&C<(B.h-this.AUTO_PAN_TOLERANCE)){this.stopPan()
}},stopPan:function(){if(!this.panning){return 
}this.panning=false;
this.direction=null;
this.step=0;
clearTimeout(this.extendedAutoPanStepTimeout);
this.extendedAutoPanStepTimeout=null;
clearInterval(this.animationInterval);
this.animationInterval=null;
this.map.events.triggerEvent("moveend")
},startPan:function(){if(this.panning){return 
}this.panning=true;
this.step=this.AUTO_PAN_STEP;
this.map.events.triggerEvent("movestart");
this.extendedAutoPanStepTimeout=setTimeout(function(){this.step=this.EXTENDED_AUTO_PAN_STEP
}.bind(this),this.EXTENDED_AUTO_PAN_DELAY);
var A=this.AUTO_PAN_INTERVAL/this.ANIMATION_STEPS;
if(this.animationInterval){clearInterval(this.animationInterval)
}this.animationInterval=setInterval(function(){this.animateMap()
}.bind(this),this.AUTO_PAN_INTERVAL/this.ANIMATION_STEPS)
},animateMap:function(){if(!this.drawingControl.currentlyDrawing){this.stopPan()
}var A=dLat=0;
var B=this.map.getResolution();
if(this.direction=="LEFT"){A=-this.step*B
}else{if(this.direction=="RIGHT"){A=this.step*B
}else{if(this.direction=="DOWN"){dLat=-this.step*B
}else{if(this.direction=="UP"){dLat=this.step*B
}}}}A=A/(this.AUTO_PAN_INTERVAL/this.ANIMATION_STEPS);
dLat=dLat/(this.AUTO_PAN_INTERVAL/this.ANIMATION_STEPS);
if(A==0&&dLat==0){this.stopPan();
return 
}var C=this.map.getCenter().clone();
C.lon+=A;
C.lat+=dLat;
if(!this.map.baseLayer.maxExtent.contains(C.lon,C.lat)){this.stopPan();
return 
}this.updateModifyFeatureControlPosition(C);
this.map.moveTo(C,this.map.zoom,{dragging:false,noEvent:true})
},updateModifyFeatureControlPosition:function(G){if(this.panning&&this.modifyFeatureControl.active){var A=this.map.getCenter();
var E=G.lon-A.lon;
var C=G.lat-A.lat;
var F=this.map.getResolution();
var D=(E/F)*-1;
var B=(C/F);
if(D!=0||B!=0){this.modifyFeatureControl.dragControl.lastPixel.x+=D;
this.modifyFeatureControl.dragControl.lastPixel.y+=B
}}},CLASS_NAME:"sMap.AutoPanControl"});sMap.expandmap={};
sMap.ExpandMap=OpenLayers.Class(OpenLayers.Control,{draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);
var C=sMap.expandmap.initialFeatureKey;
if(C==null){C={layerName:"",featureId:""}
}var A=sMap.createMapPageUrl({layer:C.layerName,id:C.featureId});
var B=$('<a title="Click here to expand the map"/>').attr("href",A);
$(this.div).append(B);
return this.div
}});sMap.Class=function(A){return sMap.Class.extend.call(null,null,A)
};
sMap.Class.chain=function(C,B,A){var D=B||new Function();
D.prototype=C;
return new D(sMap.Class.dummyArg,C,A)
};
sMap.Class.dummyArg={};
sMap.Class.extend=function(A,D){var C,B=sMap.Class.chain(A||{length:0});
C=function(E,G,F){if(E===sMap.Class.dummyArg){D.call(this,G,F)
}else{return sMap.Class.init.call(this,B,arguments)
}};
C.extend=function(E){return sMap.Class.extend.call(this,B,E)
};
Array.prototype.push.call(B,C);
return C
};
sMap.Class.init=function(A,C){var E=this,D,B={};
for(D=0;
D<A.length;
D++){E=sMap.Class.chain(E,A[D],B)
}if(E.init){E.init.apply(E,C)
}return E
};sMap.LegendControl=OpenLayers.Class(OpenLayers.Control,{HEIGHT:75,WIDTH:199,imageUrl:null,initialize:function(B,A){OpenLayers.Control.prototype.initialize.call(this,A);
this.imageUrl=B
},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);
var A=OpenLayers.Util.createAlphaImageDiv(this.id+"_img",new OpenLayers.Pixel(0,0),new OpenLayers.Size(this.WIDTH,this.HEIGHT),this.imageUrl,"absolute");
this.div.appendChild(A);
return this.div
}});sMap.HBox=OpenLayers.Class(OpenLayers.Control,{initialize:function(A){OpenLayers.Control.prototype.initialize.call(this,A);
this.$table=jQuery("<table class='hbox'><tbody><tr/></tbody></table>");
this.$table.css("cursor","default");
this.$tr=this.$table.find("tr")
},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);
this.div.appendChild(this.$table.get(0));
return this.div
},build:function(A){var B=this.$tr;
var C=this.map;
jQuery.each(A,function(){var D=jQuery("<td/>");
D.appendTo(B);
this.setMap(C);
var E=this.div||this.draw();
jQuery(E).css("position","relative");
D.append(E)
})
},removeFloatChild:function(A){$(this.$tr.children("td")[A]).children("div.child").remove()
},addFloatChild:function(D,B){$cell=$(this.$tr.children("td")[D]);
var C=$('<div class="child"/>');
C.css("position","relative");
$cell.append(C);
var A=$("<div/>").css("position","absolute");
A.append(B);
C.append(A);
return A
}});sMap.ScaleBar=OpenLayers.Class(OpenLayers.Control.ScaleLine,{MI_TO_KM:1.609344,FT_TO_M:0.3048,initialize:function(A){A.topOutUnits="mi";
A.topInUnits="ft";
A.maxWidth=300;
OpenLayers.Control.ScaleLine.prototype.initialize.call(this,A)
},update:function(){OpenLayers.Control.ScaleLine.prototype.update.call(this);
var D=this.eBottom.innerHTML.split(" ");
var F=D[0],C=D[1];
this.eBottom.innerHTML="Walk:&nbsp;"+sMap.getWalkingTime(F,C)+" Cycle:&nbsp;"+sMap.getCyclingTime(F,C);
var E=this.eTop.innerHTML.split(" ");
F=D[0];
C=D[1];
var G,B,A="";
if(C=="mi"){G=Number(F)*this.MI_TO_KM;
B="km";
A="miles"
}else{if(C=="ft"){G=Number(F)*this.FT_TO_M;
B="m";
A="ft"
}}if(B){var H;
if(String(Math.round(G)).length<2){H=(Math.round(G*10)/10)
}else{H=Math.round(G)
}this.eTop.innerHTML=String(F)+" "+A+" ("+H+" "+B+")"
}}});sMap.search={decorate:function(A){sMap.search.decorateInput(A,function(B,C){window.location=sMap.createMapPageUrl({layer:B,id:C})
})
},decorateInput:function(C,D){var E=$(C),B=E.parents("form"),A=sMap.url("/img/blank.gif");
E.autocomplete(sMap.url("/search/autocomplete"),{highlight:false,cacheLength:10,max:20,delay:3000,matchSubset:false,jumpToUniqueResult:true,noResultsMessage:"Your search did not match any locations",hideImmediatelyOnChange:true,formatItem:function(J,F,H,I){var G=J[1]||A;
return"<img src='"+G+"' alt=''/>"+J[0]
},formatSelection:function(G,F){D(G.data[2],G.data[3]);
return F
},appendTo:B}).click(function(){E.showSelect()
});
B.submit(function(){E.showSelect();
return false
})
}};sMap.search.SearchControl=OpenLayers.Class(OpenLayers.Control,{initialize:function(A){A=$.extend({allowSelection:true,type:OpenLayers.Control.TYPE_TOOL,displayClass:"search-control"},A);
OpenLayers.Control.prototype.initialize.call(this,A)
},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);
var B=$(this.div).html("<form><table><tr><td></td><td></td></tr></table></form>");
var C=B.children("form");
var E=$("<input type='text' value='Search' class='text'/>").fadedhint().appendTo(B.find("td:eq(0)").addClass("text"));
var D=$("<input type='submit' value='Go' class='submit'/>").appendTo(B.find("td:eq(1)").addClass("submit"));
function A(F){F.stopPropagation()
}B.mousedown(A).click(A).dblclick(A);
$(this.map.div).mousedown(function(F){E.hideSelect()
});
sMap.search.decorateInput(E,function(F,G){sMap.select(F,G)
});
B.find("input").focus(sMap.deactivateKeyboardControl.bind(sMap));
B.find("input").blur(sMap.activateKeyboardControl.bind(sMap));
this.activate();
return this.div
}});sMap.Toolbar=OpenLayers.Class(OpenLayers.Control,{controlData:[],$div:jQuery('<table class="olToolbar"><tbody><tr></tr></tbody></table>'),initialize:function(A){A=$.extend({allowSelection:true,type:OpenLayers.Control.TYPE_TOOL,displayClass:"search-control"},A);
OpenLayers.Control.prototype.initialize.call(this,A)
},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);
this.div.appendChild(this.$div.get(0));
return this.div
},removeControl:function(B){var A;
var C=this;
jQuery.each(this.controlData,function(D){if(this.name==B){A=D
}});
if(A){this.controlData[A].$div.remove();
this.controlData.splice(A,1)
}},addControl:function(B,A,D,E){var C=jQuery("<td/>");
this.controlData.push({name:B,img:A,description:D,callback:E,$div:C});
C.append(jQuery('<a href="javascript:void(0)"/>').append(jQuery("<img/>").attr({id:"toolbar_"+B,src:A,title:D,alt:D})));
C.click(function(){E(B)
});
this.$div.find("tr").append(C)
}});sMap.FeatureEvents=OpenLayers.Class(OpenLayers.Control,{initialize:function(B,C,A){OpenLayers.Util.extend(this,A);
OpenLayers.Control.prototype.initialize.call(this,A);
this.layer=B;
this.hover=new OpenLayers.Handler.Feature(this,this.layer,C,{})
},activate:function(){if(!this.active){this.hover.setMap(this.map);
this.hover.activate()
}return OpenLayers.Control.prototype.activate.apply(this,arguments)
},destroy:function(){OpenLayers.Control.prototype.destroy.apply(this,arguments)
},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments)
},CLASS_NAME:"sMap.FeatureEvents"});sMap.PrintControl=OpenLayers.Class(OpenLayers.Control,{$titleform:null,$maptitle:null,$addtitlebutton:null,$mapTitleDiv:null,$div:null,$textLabel:null,$table:null,initialize:function(C,A){OpenLayers.Control.prototype.initialize.call(this,A);
this.$div=$(C);
this.$titleform=$('<fieldset class="map-title-form"><form name="maptitleform" ></form></fieldset>');
this.$maptitle=$('<input type="text" name="maptitle" id="maptitle"  />');
this.$textLabel=$('<label for="maptitle">Page Title</label>');
this.$addtitlebutton=$('<input type="button" value="Print"/>');
this.$titleform.append(this.$textLabel).append($("<br>")).append(this.$maptitle).append(this.$addtitlebutton);
this.$mapTitleDiv=$("#map-title");
var B=this;
this.$addtitlebutton.click(function(){B.printDocument()
})
},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);
function A(B){B.stopPropagation()
}this.$div.mouseover(A).mousedown(A).click(A).dblclick(A).select(A);
this.$div.append(this.$titleform.hide())
},toggle:function(){var A=window.open(sMap.url("/printmap"),"printPopup"+(new Date()).getTime(),"status=1, menubar=1, height=600, width=700, resizable=0");
A.mapLoaded=function(){var B=sMap.getMapState();
A.sMap.initMap(sMap.map.getExtent());
A.sMap.map.zoomTo(sMap.map.getZoom());
A.sMap.initControls({panZoom:true,attribution:true,scaleBar:true});
A.sMap.setMapState(B)
}
},printDocument:function(){var A="<label>"+this.$maptitle.val()+"</label>";
this.$mapTitleDiv.empty().append(A);
print();
this.toggle()
}});sMap.model={};
sMap.model.EventSource=sMap.Class(function(C,A){var B=[];
this.bind=function(D){B.push(D)
};
this.unbind=function(E){for(var D=0;
D<B.length;
D++){if(B[D]===E){return B.splice(D,1)
}}};
A.trigger=function(){for(var D=0;
D<B.length;
D++){B[D].apply(this,arguments)
}}
});
sMap.model.Set=sMap.model.EventSource.extend(function(C,A){var B=[];
this.indexOf=function(E){for(var D=0;
D<B.length;
D++){if(B[D]===E){return D
}}return -1
};
this.add=function(D){if(this.indexOf(D)==-1){B.push(D);
A.trigger("add",D);
return true
}return false
};
this.remove=function(E){var D=this.indexOf(E);
if(D>-1){B.splice(D);
A.trigger("remove",E,D)
}return E
};
this.each=function(E){for(var D=0;
D<B.length;
D++){E.call(B[D],B[D],D)
}}
});
sMap.model.Layer=sMap.Class(function(C,A){var B;
this.init=function(D){B=D
};
this.name=function(){if(arguments.length>0){B=arguments[0]
}return B
}
});
sMap.model.WfsLayer=sMap.model.Layer.extend(function(D,A){var B,E,C={sldRoot:""};
this.init=function(G,H,I,F){D.init(G);
B=H;
E=I;
$.extend(C,F)
};
this.typeName=function(){return this.name()
};
this.wfsUrl=function(){return E
};
this.sldUrl=function(){return C.sldRoot+"/"+this.name()+".sld"
};
this.style=function(G){var F=this.name();
$.get(this.sldUrl(),function(L){var K=new OpenLayers.Format.SLD({externalGraphicRoot:C.sldRoot}).read(L);
var J=K.namedLayers[F].userStyles[0];
var H=999999999999,N=0;
for(var I=0;
I<J.rules.length;
I++){var M=J.rules[I];
if(M.minScaleDenominator<H){H=M.minScaleDenominator
}if(M.maxScaleDenominator>N){N=M.maxScaleDenominator
}}G(J,H,N)
})
}
});
sMap.model.Map=sMap.Class(function(A){this.selectedFeatures=new sMap.model.Set();
this.layers=new sMap.model.Set()
});sMap.XhrQueueController=sMap.model.EventSource.extend(function(J,F){var H=[],E=true,I=this,D=false;
function G(){I.pending=H.length;
F.trigger("pending change",H.length,I)
}function B(L){for(var K=0;
K<H.length;
K++){if(H[K].key===L){return K
}}return -1
}function A(){if(H.length&&!D){var L=H.shift();
function K(N){A();
var M=B(L.key);
if(M<0){L.fn(N)
}}jQuery.ajax({type:"GET",url:L.url,data:L.params,success:K,error:A,dataType:L.json?"json":null});
E=false;
G()
}else{E=true
}}function C(L){var K=B(L.key);
if(K<0){H.push(L)
}else{H.splice(K,1,L)
}if(E){A()
}G()
}this.get=function(L,K,N,M){if(N instanceof Function){M=N;
N={}
}C({key:L,url:K,params:N,fn:M})
};
this.getJSON=function(L,K,N,M){if(N instanceof Function){M=N;
N={}
}C({key:L,url:K,params:N,fn:M,json:true})
};
this.suspend=function(){D=true
};
this.resume=function(){D=false;
if(E){A()
}};
G()
});sMap.HelpControl=OpenLayers.Class(OpenLayers.Control,{url:null,$div:null,initialize:function(B,A){A=$.extend({displayClass:"htmlFrame"},A);
OpenLayers.Control.prototype.initialize.call(this,A);
this.url=B
},draw:function(){OpenLayers.Control.prototype.draw.call(this);
this.$div=$(this.div);
function A(E){E.stopPropagation()
}this.$div.mousedown(A).click(A).dblclick(A);
this.$div.hide();
var D=$('<div class="olPopupCloseBox"></div>'),C=this;
D.appendTo(this.$div).click(function(){if(!C.isCookieSet()){C.setCookie()
}C.toggle()
});
$("<h3/>").append(this.title).appendTo(this.$div);
var B=$("<iframe id='help_contents' name='help_contents' frameborder='0' class='content' src='"+this.url+"'/>");
B.appendTo(this.$div).height(this.size.h).width(this.size.w);
if(!this.isCookieSet()){this.toggle()
}return this.div
},toggle:function(){this.$div.toggle()
},showTopic:function(B){this.toggle();
var C=window.frames.help_contents;
var A=C.document.getElementById(B);
if(A){C.scrollTo(0,A.offsetTop)
}},isCookieSet:function(){return document.cookie.indexOf("show-help=false")>-1
},setCookie:function(){var A=new Date(new Date().getTime()+10*365*24*60*60*1000);
document.cookie="show-help=false;expires="+A.toUTCString()+";path=/;"
},CLASS_NAME:"sMap.HelpControl"});sMap.nearyou={xhrQueueController:new sMap.XhrQueueController(),sequence:0,updateResults:function(A){},initialise:function(){var A=jQuery("#route-results");
A.append("<div id='nearyou-results'><h3 class='title'/><div class='loading'><ul><li class='result last category'>Loading Results...</li></ul></div><div style='display: none;' class='status'/></div>");
A=jQuery("#nearyou-results");
A.children(".title").append('<a href="#">Near to here</a>');
sMap.nearyou.$loading=A.children("div.loading");
sMap.nearyou.$results=A.children("div.status");
sMap.map.events.register("movestart",null,function(){sMap.nearyou.showWaiting()
});
sMap.map.events.register("moveend",null,function(){if(false&&sMap.map.getResolution()>10){jQuery("#nearyou-results .status").empty().each(removeClasses).addClass("far-away").append("Zoom in to see things near to here.")
}else{sMap.nearyou.loadNearYou()
}});
A.find(".title a").click(function(){this.show();
return false
}.bind(this))
},show:function(){if(this.active){return 
}this.active=true;
sMap.userRouteManager.hide();
if(this.$results.html()==""||sMap.map.center!=this.lastCenter||sMap.map.zoom!=this.lastZoom){this.showWaiting();
this.loadNearYou()
}else{var A=jQuery("#route-results");
A.find("div.status").show()
}},hide:function(){this.active=false;
var A=jQuery("#route-results");
this.$loading.hide();
A.find("div.status").hide();
this.lastCenter=sMap.map.center;
this.lastZoom=sMap.map.zoom
},showWaiting:function(){if(!this.active){return 
}sMap.nearyou.$loading.show();
sMap.nearyou.$results.hide();
var A=74;
var B=$("#route-results").height()-sMap.nearyou.$loading.height()-A;
sMap.nearyou.$loading.append('<div style="height: '+B+'px">&nbsp;</div>')
},showResult:function(A,C,B){sMap.showCallout(B,"Loading...");
sMap.highlightRoute(null);
if(A=="route"){sMap.srv.findNearestRouteAccess(B,C,function(D){sMap.showCallout(B,D);
sMap.highlightRoute(C)
})
}else{sMap.select(A,C,null,true)
}},loadNearYou:function(){if(!this.active){return 
}sMap.runWhenReady(function(){var B=sMap.map.getExtent().toArray();
sMap.nearyou.sequence++;
var C=sMap.nearyou.sequence;
var A;
sMap.nearyou.xhrQueueController.get(sMap.nearyou.xhrQueueController,sMap.url("/html/nearyou"),{"box.minx":B[0],"box.maxy":B[1],"box.maxx":B[2],"box.miny":B[3],scale:sMap.map.getScale()},function(D){sMap.userRouteManager.hide();
sMap.nearyou.readResponse(D,C)
})
})
},readResponse:function(A,B){sMap.runWhenReady(function(){if(B!=sMap.nearyou.sequence){return 
}sMap.nearyou.$loading.hide();
sMap.nearyou.$results.show();
var F=$(A);
F.find("a").click(function(){var K=$(this).parent("li").children("form");
var J=K.serializeArray();
var I,M;
jQuery(J).each(function(){switch(this.name){case"pointx":I=this.value;
break;
case"pointy":M=this.value;
break
}});
var L=sMap.extractFeatureKeyFromHref(this.href);
if(L[0]){sMap.nearyou.showResult(L[0],L[1],new OpenLayers.LonLat(I,M));
return false
}});
var C=69;
var G=$("#route-results").height()-C;
var E={init:function(I){this.$results=I.find("li.result");
this.ctr=this.$results.length
},nextResult:function(){this.ctr--;
return this.ctr>0
},isFirstResult:function(){return this.ctr<1
},isFirstResultForParent:function(){return this.$results[this.ctr].parentNode.firstChild==this.$results[this.ctr]
},hide:function(){$(this.$results[this.ctr]).hide()
},hideParent:function(){$(this.$results[this.ctr]).parent("li.category").hide()
},markResultAsLast:function(){$(this.$results[this.ctr]).addClass("last")
}};
sMap.nearyou.$results.empty().append(F);
E.init(sMap.nearyou.$results);
var D=0;
while(sMap.nearyou.$results.height()>G&&!E.isFirstResult()){E.nextResult();
D++;
if(E.isFirstResultForParent()){E.hideParent()
}else{E.hide()
}}if(D!=0&&E.nextResult()){E.markResultAsLast()
}var H=G-sMap.nearyou.$results.height()-5;
sMap.nearyou.$results.append('<div style="height: '+H+'px"></div>')
})
}};sMap.ImageMapWMSLayer=OpenLayers.Class(OpenLayers.Layer.WMS,{xhrQueueController:null,initialize:function(C,B,D,E,A){this.imageMapUrl=D;
this.xhrQueueController=new sMap.XhrQueueController();
Array.prototype.splice.call(arguments,2,1);
OpenLayers.Layer.WMS.prototype.initialize.apply(this,arguments)
},addTile:function(B,A){return new sMap.ImageMapWMSTile(this,A,B,null,this.tileSize)
},getImageMapURL:function(B){var A;
this.imageUrl=this.url;
this.imageFormat=this.params.FORMAT;
this.url=this.imageMapUrl;
this.params.FORMAT="text/html";
A=OpenLayers.Layer.WMS.prototype.getURL.call(this,B);
this.url=this.imageUrl;
this.params.FORMAT=this.imageFormat;
return A
}});
sMap.ImageMapWMSTile=OpenLayers.Class(OpenLayers.Tile.Image,{mapEl:null,mapElId:null,topTile:null,initialize:function(D,A,F,B,C){OpenLayers.Tile.Image.prototype.initialize.apply(this,arguments);
var E=this.mapElId=this.getMapName();
var G=this.mapEl=document.createElement("map");
G.setAttribute("id",E);
G.setAttribute("name",E);
this.layer.map.div.appendChild(G);
this.topTile=this
},renderTile:function(){OpenLayers.Tile.Image.prototype.renderTile.apply(this,arguments);
if(this.topTile&&this.topTile.imgDiv){this.topTile.imgDiv.useMap=null;
this.topTile.imgDiv.style.cursor="wait"
}var A=this;
sMap.runWhenReady(function(){A.layer.xhrQueueController.get(A.mapElId,A.layer.getImageMapURL(A.bounds),function(B){if(B&&B.length){A.setImageMap(B)
}})
});
return true
},getMapName:function(){return this.id+"_map"
},setImageMap:function(A){if(A){var B=this;
sMap.runWhenReady(function(){if(B.topTile.imgDiv){B.topTile.imgDiv.useMap="#"+B.mapElId;
B.topTile.imgDiv.style.cursor=""
}B.mapEl.innerHTML=A.substring(A.indexOf(">")+1,A.lastIndexOf("<"))
})
}},setTopTile:function(A){if(this.topTile===A){return 
}if(this.topTile.imgDiv&&(this.topTile.imgDiv.useMap=="#"+this.mapElId)){this.topTile.imgDiv.useMap=null
}this.topTile=A;
if(this.topTile.imgDiv){this.topTile.imgDiv.useMap="#"+this.mapElId
}}});sMap.view={};
sMap.view.WfsLayerOpenLayersView=sMap.Class(function(F,B){var G,E,A,D={index:1};
function C(K,J,N){K.defaultStyle.cursor="pointer";
var I=OpenLayers.Util.getResolutionFromScale(J+0.001,G.units);
var H=OpenLayers.Util.getResolutionFromScale(N,G.units);
_protected.layer=new OpenLayers.Layer.WFS(E.name(),E.wfsUrl(),{typeName:E.typeName()},{minResolution:I,maxResolution:H,styleMap:new OpenLayers.StyleMap({"default":K,select:K}),extractAttributes:true,ratio:1});
G.addLayer(_protected.layer);
G.setLayerIndex(_protected.layer,D.index);
var M=this;
var L=new sMap.FeatureEvents(_protected.layer,{click:function(O){if(this.popup){sMap.map.removePopup(this.popup)
}var P=O.fid;
sMap.srv.loadCalloutContentWithFid(P,function(Q){sMap.srv.loadBoundsWithFid(P,function(R){M.showCallout(R,Q)
})
})
},clickout:function(O){},over:function(R){if(this.popup){sMap.map.removePopup(this.popup)
}var S=R.geometry.getBounds().getCenterLonLat();
var Q=sMap.map.getLayerPxFromViewPortPx(sMap.map.getPixelFromLonLat(S));
var O=R.style==null?10:R.style.pointRadius/2;
var P=this.popup={draw:function(){var T=jQuery("<div/>");
T.html(R.attributes.title).addClass("tooltip").css("position","absolute").css("top",Q.y-(O+T.height())).css("left",Q.x+O);
return(this.div=T.get(0))
}};
sMap.map.addPopup(P)
},out:function(O){sMap.map.removePopup(this.popup);
this.popup=null
}});
G.addControl(L);
L.activate()
}this.init=function(J,I,H){G=J;
E=I;
$.extend(D,H);
E.style(C)
};
this.showCallout=function(I,H){var J="viewCallout";
if(A){G.removePopup(A);
A=null
}A=new OpenLayers.Popup.FramedCloud(J,I.getCenterLonLat(),new OpenLayers.Size(250,150),H,null,true);
A.maxSize=new OpenLayers.Size(300,250);
G.addPopup(A)
};
this.moveToExtent=function(H){G.zoomToExtent(H)
}
});
sMap.view.SelectedRouteLayer=sMap.Class(function(B,A){this.init=function(E,D){this.map=E;
this.layers=D;
this.wms=new OpenLayers.Layer.WMS("Selected Route",sMap.constants.selectedRouteWmsUrl.split(","),{layers:sMap.constants.selectedRouteWmsLayers,transparent:true});
var C=this;
sMap.srv.loadKeyAttributes(D,function(F){C.keyAttr=F;
C.updateFilter()
})
};
this.setSelected=function(C,D){this.layerName=C;
this.featureId=D;
if(this.keyAttr){this.updateFilter()
}};
this.updateFilter=function(){var C=this.keyAttr[this.layerName];
if(C){var F={cql_filter:null,featureid:null};
if(this.keyAttr[this.layerName]){var D=this.keyAttr[this.layerName]+" = '"+this.featureId+"'";
F.cql_filter=D
}else{F.featureid=this.featureId
}this.wms.mergeNewParams(F)
}if(C){if(this.wms.map){this.wms.redraw();
this.map.events.triggerEvent("addlayer")
}else{this.map.addLayer(this.wms)
}}else{if(this.wms.div&&this.wms.div.ownerDocument){try{this.map.removeLayer(this.wms)
}catch(E){}}}};
this.saveState=function(){var C={layerName:this.layerName,featureId:this.featureId};
return C
};
this.setState=function(C){this.setSelected(C.layerName,C.featureId)
}
});sMap.srv={loadCalloutContentWithFid:function(A,B){jQuery.get(sMap.url("/html/featurecallout"),{fid:A},function(C){B(C)
})
},loadBoundsWithFid:function(A,B){jQuery.getJSON(sMap.url("/json/featureBounds"),{fid:A},function(C){B(new OpenLayers.Bounds(C.minx,C.miny,C.maxx,C.maxy))
})
},loadCalloutPointWithFid:function(A,B){jQuery.getJSON(sMap.url("/json/featurecalloutpoint"),{fid:A},function(C){B(new OpenLayers.LonLat(C.x,C.y))
})
},loadCalloutContent:function(A,B,C){jQuery.get(sMap.url("/html/featurecallout"),{"featureKey.layerName":A,"featureKey.featureId":B},function(D){C(D)
})
},loadBounds:function(A,B,C){jQuery.getJSON(sMap.url("/json/featureBounds"),{"featureKey.layerName":A,"featureKey.featureId":B},function(D){C(new OpenLayers.Bounds(D.minx,D.miny,D.maxx,D.maxy))
})
},loadCalloutPoint:function(A,B,C){jQuery.getJSON(sMap.url("/json/featurecalloutpoint"),{"featureKey.layerName":A,"featureKey.featureId":B},function(D){C(new OpenLayers.LonLat(D.x,D.y))
})
},loadKeyAttribute:function(A,B){jQuery.getJSON(sMap.url("/json/layerKey"),{layerName:A},function(C){B(C.value)
})
},loadKeyAttributes:function(C,D){var A={};
var B=0;
jQuery.each(C,function(E){var F=this;
jQuery.getJSON(sMap.url("/json/layerKey"),{layerName:this},function(G){A[F]=G.value;
B++;
if(B==C.length){D(A)
}})
})
},findNearestRouteAccess:function(A,C,B){jQuery.get(sMap.url("/findnearestrouteaccess"),{routeId:C,"from.x":A.lon,"from.y":A.lat},function(D){B(D)
})
},loadUserRoutes:function(A){jQuery.getJSON(sMap.url("/json/getuserroutes"),{t:(new Date().getTime())},function(C,B){A(C,B)
})
},loadSharedRoute:function(B,A){jQuery.getJSON(sMap.url("/json/getuserroute"),{id:B},function(D,C){A(D,C)
})
},deleteUserRoute:function(B,A){jQuery.post(sMap.url("/json/deleteuserroute"),{id:B},function(D,C){A(D,C)
},"json")
},saveUserRoute:function(H,A,D,B,C,F,G){var E={name:A,description:D,color:B,opacity:C,geometry:F};
if(H){E.id=H
}jQuery.post(sMap.url("/json/saveuserroute"),E,function(J,I){G(J,I)
},"json")
},updateMapSession:function(){jQuery.getJSON(sMap.url("/json/getuserroutes"),{t:(new Date().getTime())},function(){})
}};sMap.SurveyControl=OpenLayers.Class(OpenLayers.Control,{url:null,$div:null,initialize:function(B,A){A=$.extend({displayClass:"htmlFrame"},A);
OpenLayers.Control.prototype.initialize.call(this,A);
this.url=B
},draw:function(){OpenLayers.Control.prototype.draw.call(this);
this.$div=$(this.div);
function G(J){J.stopPropagation()
}this.$div.mousedown(G).click(G).dblclick(G);
this.$div.hide();
var C=$('<div class="olPopupCloseBox"></div>'),F=this;
C.appendTo(this.$div).click(function(){F.postpone()
});
$("<h3/>").append(this.title).appendTo(this.$div);
var I=$('<p style="font-size:1.3em;">Please help us to understand more about users\' views on environmental behaviour, particularly in relation to travel. This survey should only take a few minutes to complete. Thank you very much for your help with this important survey.</p>');
I.appendTo(this.$div);
var D=$('<div class="search-control survey-buttons" />');
var E=$('<input type="button" class="submit" value="Take survey" style="margin: 5px; padding: 3px;" />');
var H=$('<input type="button" class="submit" value="Ask again later" style="margin: 5px; padding: 3px;" />');
var A=$('<input type="button" class="submit" value="No thank you" style="margin: 5px; padding: 3px;"  />');
E.appendTo(D);
A.appendTo(D);
H.appendTo(D);
D.appendTo(this.$div);
var B=$('<div id="survey_logo"></div>');
B.appendTo(this.$div);
E.click(function(){F.accept()
});
A.click(function(){F.decline()
});
H.click(function(){F.postpone()
});
this.$div.height(this.size.h).width(this.size.w);
if(!this.isCookieSet()||this.isPostponed()){this.show()
}return this.div
},show:function(){this.$div.show()
},hide:function(){this.$div.hide()
},decline:function(){this.setCookie(sMap.SurveyControl.DECLINE_SURVEY);
this.hide()
},postpone:function(){this.setCookie(sMap.SurveyControl.POSTPONE_SURVEY);
this.hide()
},accept:function(){var A=window.open(this.url,"surveyWindow");
if(A){this.setCookie(sMap.SurveyControl.ACCEPT_SURVEY);
this.hide()
}},isPostponed:function(){return document.cookie.indexOf("show-survey="+sMap.SurveyControl.POSTPONE_SURVEY)>-1
},isCookieSet:function(){return document.cookie.indexOf("show-survey=")>-1
},setCookie:function(B){var A=new Date(new Date().getTime()+10*365*24*60*60*1000);
document.cookie="show-survey="+B+";expires="+A.toUTCString()+";path=/;"
}});
sMap.SurveyControl.ACCEPT_SURVEY="accept";
sMap.SurveyControl.DECLINE_SURVEY="decline";
sMap.SurveyControl.POSTPONE_SURVEY="postpone";})(jQuery);
