/*

  OpenLayers.js -- OpenLayers Map Viewer Library

  Copyright 2005-2008 MetaCarta, Inc., released under the Clear BSD license.
  Please see http://svn.openlayers.org/trunk/openlayers/license.txt
  for the full text of the license.

  Includes compressed code under the following licenses:

  (For uncompressed versions of the code used please see the
  OpenLayers SVN repository: <http://openlayers.org/>)

*/

/* Contains portions of Prototype.js:
 *
 * Prototype JavaScript framework, version 1.4.0
 *  (c) 2005 Sam Stephenson <sam@conio.net>
 *
 *  Prototype is freely distributable under the terms of an MIT-style license.
 *  For details, see the Prototype web site: http://prototype.conio.net/
 *
 *--------------------------------------------------------------------------*/

/**  
*  
*  Contains portions of Rico <http://openrico.org/>
* 
*  Copyright 2005 Sabre Airline Solutions  
*  
*  Licensed under the Apache License, Version 2.0 (the "License"); you
*  may not use this file except in compliance with the License. You
*  may obtain a copy of the License at
*  
*         http://www.apache.org/licenses/LICENSE-2.0  
*  
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
*  implied. See the License for the specific language governing
*  permissions and limitations under the License. 
*
**/

/**
 * Contains XMLHttpRequest.js <http://code.google.com/p/xmlhttprequest/>
 * Copyright 2007 Sergey Ilinsky (http://www.ilinsky.com)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * http://www.apache.org/licenses/LICENSE-2.0
 */

/**
 * Contains portions of Gears <http://code.google.com/apis/gears/>
 *
 * Copyright 2007, Google Inc.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 *  1. Redistributions of source code must retain the above copyright notice,
 *     this list of conditions and the following disclaimer.
 *  2. Redistributions in binary form must reproduce the above copyright notice,
 *     this list of conditions and the following disclaimer in the documentation
 *     and/or other materials provided with the distribution.
 *  3. Neither the name of Google Inc. nor the names of its contributors may be
 *     used to endorse or promote products derived from this software without
 *     specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
 * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * Sets up google.gears.*, which is *the only* supported way to access Gears.
 *
 * Circumvent this file at your own risk!
 *
 * In the future, Gears may automatically define google.gears.* without this
 * file. Gears may use these objects to transparently fix bugs and compatibility
 * issues. Applications that use the code below will continue to work seamlessly
 * when that happens.
 */
function op___test(){}
(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.isArray(selector)?selector:jQuery.makeArray(selector));},selector:"",jquery:"1.3.2",size:function(){return this.length;},get:function(num){return num===undefined?Array.prototype.slice.call(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,sort:[].sort,splice:[].splice,find:function(selector){if(this.length===1){var ret=this.pushStack([],"find",selector);ret.length=0;jQuery.find(selector,this[0],ret);return ret;}else{return this.pushStack(jQuery.unique(jQuery.map(this,function(elem){return jQuery.find(selector,elem);})),"find",selector);}},clone:function(events){var ret=this.map(function(){if(!jQuery.support.noCloneEvent&&!jQuery.isXMLDoc(this)){var html=this.outerHTML;if(!html){var div=this.ownerDocument.createElement("div");div.appendChild(this.cloneNode(true));html=div.innerHTML;}
return jQuery.clean([html.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0];}else
return this.cloneNode(true);});if(events===true){var orig=this.find("*").andSelf(),i=0;ret.find("*").andSelf().each(function(){if(this.nodeName!==orig[i].nodeName)
return;var events=jQuery.data(orig[i],"events");for(var type in events){for(var handler in events[type]){jQuery.event.add(this,type,events[type][handler],events[type][handler].data);}}
i++;});}
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,closer=0;return this.map(function(){var cur=this;while(cur&&cur.ownerDocument){if(pos?pos.index(cur)>-1:jQuery(cur).is(selector)){jQuery.data(cur,"closest",closer);return cur;}
cur=cur.parentNode;closer++;}});},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.replace(/ jQuery\d+="(?:\d+|null)"/g,""):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;if(first)
for(var i=0,l=this.length;i<l;i++)
callback.call(root(this[i],first),this.length>1||i>0?fragment.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){if(data&&/\S/.test(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,extra){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;if(extra==="border")
return;jQuery.each(which,function(){if(!extra)
val-=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0;if(extra==="margin")
val+=parseFloat(jQuery.curCSS(elem,"margin"+this,true))||0;else
val-=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0;});}
if(elem.offsetWidth!==0)
getWH();else
jQuery.swap(elem,props,getWH);return Math.max(0,Math.round(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=elem.replace(/^\s+/,"").substring(0,10).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 hasBody=/<tbody/i.test(elem),tbody=!tags.indexOf("<table")&&!hasBody?div.firstChild&&div.firstChild.childNodes:wrap[1]=="<table>"&&!hasBody?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(selector){var ret=[],insert=jQuery(selector);for(var i=0,l=insert.length;i<l;i++){var elems=(i>0?this.clone(true):this).get();jQuery.fn[original].apply(jQuery(insert[i]),elems);ret=ret.concat(elems);}
return this.pushStack(ret,name,selector);};});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).children().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);});}});(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);if(sortOrder){hasDuplicate=false;results.sort(sortOrder);if(hasDuplicate){for(var i=1;i<results.length;i++){if(results[i]===results[i-1]){results.splice(i--,1);}}}}}
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,isXMLFilter=set&&set[0]&&isXML(set[0]);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,isXMLFilter);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;}}}
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,isXML){var isPartStr=typeof part==="string",isTag=isPartStr&&!/\W/.test(part),isPartStrNotTag=isPartStr&&!isTag;if(isTag&&!isXML){part=part.toUpperCase();}
for(var i=0,l=checkSet.length,elem;i<l;i++){if((elem=checkSet[i])){while((elem=elem.previousSibling)&&elem.nodeType!==1){}
checkSet[i]=isPartStrNotTag||elem&&elem.nodeName===part?elem||false:elem===part;}}
if(isPartStrNotTag){Sizzle.filter(part,checkSet,true);}},">":function(checkSet,part,isXML){var isPartStr=typeof part==="string";if(isPartStr&&!/\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]=isPartStr?elem.parentNode:elem.parentNode===part;}}
if(isPartStr){Sizzle.filter(part,checkSet,true);}}},"":function(checkSet,part,isXML){var doneName=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++,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"){var ret=[],results=context.getElementsByName(match[1]);for(var i=0,l=results.length;i<l;i++){if(results[i].getAttribute("name")===match[1]){ret.push(results[i]);}}
return ret.length===0?null:ret;}},TAG:function(match,context){return context.getElementsByTagName(match[1]);}},preFilter:{CLASS:function(match,curLoop,inplace,result,not,isXML){match=" "+match[1].replace(/\\/g,"")+" ";if(isXML){return match;}
for(var i=0,elem;(elem=curLoop[i])!=null;i++){if(elem){if(not^(elem.className&&(" "+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++;return match;},ATTR:function(match,curLoop,inplace,result,not,isXML){var name=match[1].replace(/\\/g,"");if(!isXML&&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||/^\w/.test(match[3])){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])||Expr.match.CHILD.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:{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;}},CHILD:function(elem,match){var type=match[1],node=elem;switch(type){case'only':case'first':while(node=node.previousSibling){if(node.nodeType===1)return false;}
if(type=='first')return true;node=elem;case'last':while(node=node.nextSibling){if(node.nodeType===1)return false;}
return true;case'nth':var first=match[2],last=match[3];if(first==1&&last==0){return true;}
var doneName=match[0],parent=elem.parentNode;if(parent&&(parent.sizcache!==doneName||!elem.nodeIndex)){var count=0;for(node=parent.firstChild;node;node=node.nextSibling){if(node.nodeType===1){node.nodeIndex=++count;}}
parent.sizcache=doneName;}
var diff=elem.nodeIndex-last;if(first==0){return diff==0;}else{return(diff%first==0&&diff/first>=0);}}},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(" "+(elem.className||elem.getAttribute("class"))+" ").indexOf(match)>-1;},ATTR:function(elem,match){var name=match[1],result=Expr.attrHandle[name]?Expr.attrHandle[name](elem):elem[name]!=null?elem[name]:elem.getAttribute(name),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:!check?value&&result!==false: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;};}
var sortOrder;if(document.documentElement.compareDocumentPosition){sortOrder=function(a,b){var ret=a.compareDocumentPosition(b)&4?-1:a===b?0:1;if(ret===0){hasDuplicate=true;}
return ret;};}else if("sourceIndex"in document.documentElement){sortOrder=function(a,b){var ret=a.sourceIndex-b.sourceIndex;if(ret===0){hasDuplicate=true;}
return ret;};}else if(document.createRange){sortOrder=function(a,b){var aRange=a.ownerDocument.createRange(),bRange=b.ownerDocument.createRange();aRange.selectNode(a);aRange.collapse(true);bRange.selectNode(b);bRange.collapse(true);var ret=aRange.compareBoundaryPoints(Range.START_TO_END,bRange);if(ret===0){hasDuplicate=true;}
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&&typeof div.firstChild.getAttribute!=="undefined"&&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)(function(){var div=document.createElement("div");div.innerHTML="<div class='test e'></div><div class='test'></div>";if(div.getElementsByClassName("e").length===0)
return;div.lastChild.className="e";if(div.getElementsByClassName("e").length===1)
return;Expr.order.splice(1,0,"CLASS");Expr.find.CLASS=function(match,context,isXML){if(typeof context.getElementsByClassName!=="undefined"&&!isXML){return context.getElementsByClassName(match[1]);}};})();function dirNodeCheck(dir,cur,doneName,checkSet,nodeCheck,isXML){var sibDir=dir=="previousSibling"&&!isXML;for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){if(sibDir&&elem.nodeType===1){elem.sizcache=doneName;elem.sizset=i;}
elem=elem[dir];var match=false;while(elem){if(elem.sizcache===doneName){match=checkSet[elem.sizset];break;}
if(elem.nodeType===1&&!isXML){elem.sizcache=doneName;elem.sizset=i;}
if(elem.nodeName===cur){match=elem;break;}
elem=elem[dir];}
checkSet[i]=match;}}}
function dirCheck(dir,cur,doneName,checkSet,nodeCheck,isXML){var sibDir=dir=="previousSibling"&&!isXML;for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){if(sibDir&&elem.nodeType===1){elem.sizcache=doneName;elem.sizset=i;}
elem=elem[dir];var match=false;while(elem){if(elem.sizcache===doneName){match=checkSet[elem.sizset];break;}
if(elem.nodeType===1){if(!isXML){elem.sizcache=doneName;elem.sizset=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 elem.offsetWidth===0||elem.offsetHeight===0;};Sizzle.selectors.filters.visible=function(elem){return elem.offsetWidth>0||elem.offsetHeight>0;};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);event.currentTarget=this;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});}});elems.sort(function(a,b){return jQuery.data(a.elem,"closest")-jQuery.data(b.elem,"closest");});jQuery.each(elems,function(){if(this.fn.call(this.elem,event,this.fn.data)===false)
return(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&&window==window.top)(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=div.style.paddingLeft="1px";document.body.appendChild(div);jQuery.boxModel=jQuery.support.boxModel=div.offsetWidth===2;document.body.removeChild(div).style.display='none';});})();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|search/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();script.onload=script.onreadystatechange=null;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;}
jQuery.data(this[i],"olddisplay",display);}}
for(var i=0,l=this.length;i<l;i++){this[i].style.display=jQuery.data(this[i],"olddisplay")||"";}
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"));}
for(var i=0,l=this.length;i<l;i++){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)&&!timerId){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);timerId=undefined;}},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",lower=name.toLowerCase();jQuery.fn["inner"+name]=function(){return this[0]?jQuery.css(this[0],lower,false,"padding"):null;};jQuery.fn["outer"+name]=function(margin){return this[0]?jQuery.css(this[0],lower,false,margin?"margin":"border"):null;};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");};});})();function RefereshClick()
{document.aspnetForm.submit();}
function RemoveFilter(layerID,acivatedFrom)
{PageMethods.RemoveFilterLabel(layerID,acivatedFrom);}
function Filter(layerID,acivatedFrom)
{var path="/WebPages/Search/Filter/Filter.aspx";if(window.NGServerUrl)
{path=NGServerUrl()+path;}
else
{var protocol=window.location.protocol;var theHost=window.location.hostname;var port=window.location.port;if(port)
{port=":"+port;}
var ThePath=window.location.pathname;ThePath=ThePath.substring(0,ThePath.indexOf("/",1));path=protocol+"//"+theHost+port+ThePath+path;}
var filterUrl=path+"?LAYERID="+layerID+"&ACTIVATEDFROM="+acivatedFrom;window.parent.NgOpenPopup(filterUrl,400,327,'Filter Definition',true);}
function FilterForSearch(searchid,acivatedFrom)
{var path="/WebPages/Search/Filter/Filter.aspx";if(window.NGServerUrl)
{path=NGServerUrl()+path;}
else
{var protocol=window.location.protocol;var theHost=window.location.hostname;var port=window.location.port;if(port)
{port=":"+port;}
var ThePath=window.location.pathname;ThePath=ThePath.substring(0,ThePath.indexOf("/",1));path=protocol+"//"+theHost+port+ThePath+path;}
var filterUrl=path+"?SEARCHID="+searchid+"&ACTIVATEDFROM="+acivatedFrom;window.parent.NgOpenPopup(filterUrl,400,327,_filterWindowTitle,true);}
function FilterForSelection(searchid,acivatedFrom)
{var path="/WebPages/Search/Filter/Filter.aspx";if(window.NGServerUrl)
{path=NGServerUrl()+path;}
else
{var protocol=window.location.protocol;var theHost=window.location.hostname;var port=window.location.port;if(port)
{port=":"+port;}
var ThePath=window.location.pathname;ThePath=ThePath.substring(0,ThePath.indexOf("/",1));path=protocol+"//"+theHost+port+ThePath+path;}
var filterUrl=path+"?SELECTIONID="+searchid+"&ACTIVATEDFROM="+acivatedFrom;window.parent.NgOpenPopup(filterUrl,400,327,_filterWindowTitle,true);}
function CollapseOrExpand(divElem,imgElem,collapseImgUrl,expandImgUrl,hiddenElem,callbackFunction)
{var div=document.getElementById(divElem);var img=document.getElementById(imgElem);var hidden=document.getElementById(hiddenElem);if(div.style.visibility=="hidden")
{div.style.visibility='visible';div.style.display='block';var imgCollapse=new Image();imgCollapse.src=collapseImgUrl;img.src=imgCollapse.src;img.title="Collapse";}
else
{div.style.visibility='hidden';div.style.display='none';var imgExpand=new Image();imgExpand.src=expandImgUrl;img.src=imgExpand.src;img.title="Expand";hidden.value="Collapse";}
hidden.value=div.style.visibility;changeiframeHeight(window.top._SearchIframe);changeiframeWidth(window.top._SearchIframe);if(callbackFunction!=null)
{eval(callbackFunction);}}
function searchClick()
{}
function checkRadioOption(radElemId)
{if(radElemId!=null)
{var radElem=document.getElementById(radElemId);if(radElem!=null)
{radElem.checked=true;}}}
function checkResultSetFilterOption(resultSetFilterId,currentExtentFilterId,hidElement)
{if(resultSetFilterId!=null&&currentExtentFilterId!=null)
{var resultSetFilterElem=document.getElementById(resultSetFilterId);var currentExtentFilterElem=document.getElementById(currentExtentFilterId);var hidElem=document.getElementById(hidElement);if(hidElem)
{if(resultSetFilterElem&&currentExtentFilterElem&&resultSetFilterElem.checked==1&&currentExtentFilterElem.checked==1)
{hidElem.value='ALL';}
else if(currentExtentFilterElem&&currentExtentFilterElem.checked==1)
{hidElem.value=currentExtentFilterElem.value;}
else if(resultSetFilterElem&&resultSetFilterElem.checked==1)
{hidElem.value=resultSetFilterElem.value;}
else
{hidElem.value='NONE';}}}
var divSubjectAreaMessage=document.getElementById("divSubjectAreaNotAllowed");if(divSubjectAreaMessage)
{if((currentExtentFilterElem&&currentExtentFilterElem.checked==1)||(resultSetFilterElem&&resultSetFilterElem.checked==1))
{divSubjectAreaMessage.style.display="";}
else
{divSubjectAreaMessage.style.display="none";}
ResizePage();}
var divOverlaySearchMessage=document.getElementById("divOverlaySearchNotAllowed");if(divOverlaySearchMessage)
{if((currentExtentFilterElem&&currentExtentFilterElem.checked==1)||(resultSetFilterElem&&resultSetFilterElem.checked==1))
{divOverlaySearchMessage.style.display="";}
else
{divOverlaySearchMessage.style.display="none";}
ResizePage();}}
function UpdateSearchPanel()
{document.forms[0].submit();}
function InvokeMethod(funcName)
{eval(funcName);}
function UnSelectListItems(lstElemId,items)
{if(lstElemId!=null&&items!=null)
{var lstElem=document.getElementById(lstElemId);if(lstElem!=null)
{for(i=0;i<lstElem.options.length;i++)
{if(items.contains("~|~"+lstElem.options[i].value+"~|~"))
{lstElem.options[i].selected=false;}}}}}
(function($)
{$.alerts={verticalOffset:-75,horizontalOffset:0,repositionOnResize:true,overlayOpacity:.01,overlayColor:'#FFF',draggable:true,okButton:'&nbsp;OK&nbsp;',cancelButton:'&nbsp;Cancel&nbsp;',dialogClass:null,iconStyle:'warning',alert:function(message,title,callback)
{if(title==null)title='Alert';$.alerts._show(title,message,null,'alert',function(result)
{if(callback)callback(result);});},confirm:function(message,title,callback)
{if(title==null)title='Confirm';$.alerts._show(title,message,null,'confirm',function(result)
{if(callback)callback(result);});},prompt:function(message,value,title,callback)
{if(title==null)title='Prompt';$.alerts._show(title,message,value,'prompt',function(result)
{if(callback)callback(result);});},_show:function(title,msg,value,type,callback)
{$.alerts._hide();$.alerts._overlay('show');$("BODY").append('<div id="popup_container">'+'<h1 id="popup_title"></h1>'+'<div id="popup_content">'+'<div id="popup_message"></div>'+'</div>'+'</div>');if($.alerts.dialogClass)$("#popup_container").addClass($.alerts.dialogClass);var pos=($.browser.msie&&parseInt($.browser.version)<=6)?'absolute':'fixed';$("#popup_container").css({position:pos,zIndex:99999,padding:0,margin:0});var message=msg;var src='';switch($.alerts.iconStyle)
{case"error":src="../../Images/Error.png";break;case"question":src="../../Images/Question.png";break;case"warning":src="../../Images/warning.jpg";break;case"info":src="../../Images/info.jpg";break;}
if(src!='')
message="<table width=\"100%\"><tr><td width=\"15%\"><img align=\"left\" src=\""+src+"\" /></td><td><span valign=\"center\" >"+msg+"</span></td></tr></table>";$("#popup_title").html("&nbsp;"+title);$("#popup_content").addClass(type);$("#popup_message").text(message);$("#popup_message").html($("#popup_message").text().replace(/\n/g,'<br />'));$("#popup_container").css({minWidth:$("#popup_container").outerWidth(),maxWidth:$("#popup_container").outerWidth()});$.alerts._reposition();$.alerts._maintainPosition(true);switch(type)
{case'alert':$("#popup_message").after('<div id="popup_panel"><input type="button" value="'+$.alerts.okButton+'" id="popup_ok" class="btn" /></div>');$("#popup_ok").click(function()
{$.alerts._hide();callback(true);});$("#popup_ok").focus().keypress(function(e)
{if(e.keyCode==13||e.keyCode==27)$("#popup_ok").trigger('click');});break;case'confirm':$("#popup_message").after('<div id="popup_panel"><input class="btn" type="button" value="'+$.alerts.okButton+'" id="popup_ok" /> <input class="btn" type="button" value="'+$.alerts.cancelButton+'" id="popup_cancel" /></div>');$("#popup_ok").click(function()
{$.alerts._hide();if(callback)callback(true);});$("#popup_cancel").click(function()
{$.alerts._hide();if(callback)callback(false);});$("#popup_ok").focus();$("#popup_ok, #popup_cancel").keypress(function(e)
{if(e.keyCode==13)$("#popup_ok").trigger('click');if(e.keyCode==27)$("#popup_cancel").trigger('click');});break;case'prompt':$("#popup_message").append('<br /><input type="text" size="30" id="popup_prompt" />').after('<div id="popup_panel"><input type="button" value="'+$.alerts.okButton+'" id="popup_ok" class="btn" /> <input type="button" value="'+$.alerts.cancelButton+'" id="popup_cancel" class="btn" /></div>');$("#popup_prompt").width($("#popup_message").width());$("#popup_ok").click(function()
{var val=$("#popup_prompt").val();$.alerts._hide();if(callback)callback(val);});$("#popup_cancel").click(function()
{$.alerts._hide();if(callback)callback(null);});$("#popup_prompt, #popup_ok, #popup_cancel").keypress(function(e)
{if(e.keyCode==13)$("#popup_ok").trigger('click');if(e.keyCode==27)$("#popup_cancel").trigger('click');});if(value)$("#popup_prompt").val(value);$("#popup_prompt").focus().select();break;}
if($.alerts.draggable)
{try
{$("#popup_container").draggable({handle:$("#popup_title")});$("#popup_title").css({cursor:'move'});}catch(e){}}},_hide:function()
{$("#popup_container").remove();$.alerts._overlay('hide');$.alerts._maintainPosition(false);},_overlay:function(status)
{switch(status)
{case'show':$.alerts._overlay('hide');$("BODY").append('<div id="popup_overlay"></div>');$("#popup_overlay").css({position:'absolute',zIndex:99998,top:'0px',left:'0px',width:'100%',height:$(document).height(),background:$.alerts.overlayColor,opacity:$.alerts.overlayOpacity});break;case'hide':$("#popup_overlay").remove();break;}},_reposition:function()
{var top=(($(window).height()/2)-($("#popup_container").outerHeight()/2))+$.alerts.verticalOffset;var left=(($(window).width()/2)-($("#popup_container").outerWidth()/2))+$.alerts.horizontalOffset;if(top<0)top=0;if(left<0)left=0;if($.browser.msie&&parseInt($.browser.version)<=6)top=top+$(window).scrollTop();$("#popup_container").css({top:top+'px',left:left+'px'});$("#popup_overlay").height($(document).height());},_maintainPosition:function(status)
{if($.alerts.repositionOnResize)
{switch(status)
{case true:$(window).bind('resize',$.alerts._reposition);break;case false:$(window).unbind('resize',$.alerts._reposition);break;}}}}
jAlert=function(message,title,OKText,iconStyle,callback)
{if(OKText!=null)
$.alerts.okButton=OKText;$.alerts.iconStyle=iconStyle;$.alerts.alert(message,title,callback);}
jConfirm=function(message,title,OKText,CancelText,callback)
{if(OKText!=null)
$.alerts.okButton=OKText;if(CancelText!=null)
$.alerts.cancelButton=CancelText;$.alerts.iconStyle='question';$.alerts.confirm(message,title,callback);};jPrompt=function(message,value,title,OKText,CancelText,callback)
{if(OKText!=null)
$.alerts.okButton=OKText;if(CancelText!=null)
$.alerts.cancelButton=CancelText;$.alerts.iconStyle='question';$.alerts.prompt(message,value,title,callback);};})(jQuery);﻿
function getOptionText(drpElemId)
{var optionValue=null;if(drpElemId!=null)
{var drpElem=document.getElementById(drpElemId);if(drpElem!=null)
{try{if(drpElem.options.length>0)
{var selectedIndex=drpElem.selectedIndex;if(drpElem!=null&&selectedIndex!=null)
{var option=drpElem.options[selectedIndex];if(option!=null)
{optionValue=option.text;}}}}catch(e){}}}
return optionValue;}
function cmb_onMouseOut(labelComboDivId,comboDivId,textElemId,comboElemId)
{toggleLabelComboDivVisibility(labelComboDivId,comboDivId,true,textElemId,comboElemId);}
function onComboChange(textElemId,comboElemId)
{try
{var selectedText=getOptionText(comboElemId);var textElem=document.getElementById(textElemId);if(textElem!=null)
{textElem.innerHTML=selectedText;}}catch(e){}}
function RefreshDropdownControl(drpElemId)
{if(drpElemId!=null)
{var drpElem=document.getElementById(drpElemId);if(drpElem!=null)
{var textElemId=drpElem.getAttribute("TEXTBOX_ID");onComboChange(textElemId,drpElemId);}}}
function ShowCoboHideLabel(lebel_id,cmb_id)
{if(cmb_id!=null)
{ToggleLayer(cmb_id,null,null);}
if(lebel_id!=null)
{ToggleLayer(lebel_id,null,null);}
return;}
function ToggleLayer(elmId){try{if(document.getElementById(elmId).style.display==" "||document.getElementById(elmId).style.display=="block")
{document.getElementById(elmId).style.display='none';}
else
{document.getElementById(elmId).style.display='block';}}catch(e)
{}
return;}
function HideCoboShowLabel(lebel_id,cmb_id)
{try{if(cmb_id!=null)
document.getElementById(cmb_id).style.display='none';if(lebel_id!=null)
document.getElementById(lebel_id).style.display='block';}catch(e){}
return;}
function HideDropdownControl(cmbElem)
{if(cmbElem!=null)
{var lblCmbId=cmbElem.getAttribute("LABEL_COMBO_ID");if(lblCmbId!=null)
{document.getElementById(lblCmbId).style.display='none';}
else
{cmbElem.style.visibility='hidden';cmbElem.style.display='none';}}}
function ShowDropdownControl(cmbElem)
{if(cmbElem!=null)
{var lblCmbId=cmbElem.getAttribute("LABEL_COMBO_ID");if(lblCmbId!=null)
{document.getElementById(lblCmbId).style.display='block';}
else
{cmbElem.style.visibility='visible';cmbElem.style.display='block';}}}
var g_appInternalTransfer=false;var g_searchLaunchedFromSelections=false;var g_sessionConfirmed=false;var selDiv;var prevMapScale=0;function init(){OverrideASPNetMenuFunction();HandleMoreSearchLink();try{if(NgGetElementById(_SearchListContainer).style.display==''){NgGetElementById(_SearchListContainer).style.display='block';}}catch(e){}
try{if(NgGetElementById(_MapOverViewLayer)!=null){if(NgGetElementById(_MapOverViewLayer).style.display=='block')
HandleOverviewMapFrame(null);}}catch(e){}
try{if(NgGetElementById(_PlugInMapToolsLayer)!=null){if(NgGetElementById(_PlugInMapToolsLayer).style.display=='block')
HandlePluginMeasureFrame(null);}}catch(e){}
try{if(NgGetElementById(_InfoLayer).style.display=='block'){HandleInfoToolFrame(null);}}catch(e){}
try{if(NgGetElementById(_ViewMetadata).style.display=='block'){HandleMetadataToolFrame(null);}}catch(e){}
try{if(NgGetElementById(_ViewChart).style.display=='block'){HandleChartToolFrame(null);}}catch(e){}
try{currMapScale=round(mapCtrl.getScale());if(NgGetElementById(_LegendLayer)!=null&&NgGetElementById(_LegendLayer).style.display=='block'&&currMapScale!=prevMapScale)
{HandleLegendFrame(null);}
prevMapScale=currMapScale;}catch(e){}
try{if(NgGetElementById(_PrintLayer).style.display=='block'){HandlePrintFrame(null);}}catch(e){}
try{if(NgGetElementById(_MapSnapshotLayer).style.display=='block'){HandleMapSnapshotWindow(null);}}catch(e){}
try{if(NgGetElementById(_ReportsLayer).style.display=='block'){HandleReportsFrame(null);}}catch(e){}
try{if(NgGetElementById(_SearchControlLayer).style.display=='block'){HandleSearchFrame(null);}}catch(e){}
try{if(NgGetElementById(_NearbySearchControlLayer).style.display=='block'){HandleNearbySearchFrame(null);}}catch(e){}
try{if(NgGetElementById(_AttributeEditorLayer).style.display=='block'){ShowAttributeEditor();}
if(NgGetElementById(_AttributeEditorLayer).style.display==''){NgGetElementById(_AttributeEditorLayer).style.display='block'}}catch(e){}
try{if(NgGetElementById(_ThemeLayer).style.display=='block'){HandleThemeFrame(null);}}catch(e){}
try{if(NgGetElementById(_TMDBSearchLayer).style.display=='block'){HandleTMDBSearchFrame(null);}}catch(e){}
try{if(NgGetElementById(_ManageThemeLayer).style.display=='block'){HandleManageThemeFrame(null);}}catch(e){}
try{if(NgGetElementById(_TMSymbolEditor).style.display=='block'){HandleTMSymbolEditorFrame(null);}}catch(e){}
try{if(NgGetElementById(_TMColorScheme).style.display=='block'){HandleTMColorSchemeFrame(null);}}catch(e){}
try{if(NgGetElementById(_VertexToolbarPan)!=null){if(NgGetElementById(_VertexToolbarPan).style.display!='none')
HideLayer(_VertexToolbarPan);}}catch(e){}
try{if(NgGetElementById(_RetriveSelectionLayer).style.display=='block'){HandleRetriveSelectionFrame(null);}}catch(e){}
try{if(NgGetElementById(_GenerateUrlLayer).style.display=='block'){HandleGenerateUrlFrame(null);}}catch(e){}
try{if(NgGetElementById(_DocumentViewerLayer).style.display=='block'){HandleDocumentViewerFrame(null);}}catch(e){}}
function OverrideASPNetMenuFunction(){try{var oldMenu_HideItems=Menu_HideItems;if(oldMenu_HideItems){Menu_HideItems=function(items){if(!items||((typeof(items.tagName)=="undefined")&&(items instanceof Event))){items=__rootMenuItem;}
if(items&&items.rows&&items.rows.length==0){items.insertRow(0);}
return oldMenu_HideItems(items);}}}
catch(e){}}
function HandleMetadataToolFrame(url){if(url==null){url=NgGetElementById(_ViewMetadataURLHolder).value;}
if(NgGetElementById(_ViewMetadata)!=null){ShowLayer(_ViewMetadata,null,null);if(url!=null){PopulateiFrame(_ViewMetadataiFrame,url,null,null)
NgGetElementById(_ViewMetadataURLHolder).value=url;}}
return;}
function HandleChartToolFrame(url){if(url==null){url=NgGetElementById(_ViewChartURLHolder).value;}
if(NgGetElementById(_ViewChart)!=null){ShowLayer(_ViewChart,null,null);if(url!=null){PopulateiFrame(_ViewChartiFrame,url,null,null)
NgGetElementById(_ViewChartURLHolder).value=url;}}
return;}
function HandleWMSInfoToolFrame(url){if(url==null){url=NgGetElementById(_WMSInfoURLHolder).value;}
if(NgGetElementById(_WMSInfoLayer)!=null){ShowLayer(_WMSInfoLayer,null,null);if(url!=null){PopulateiFrame(_WMSInfoiFrame,url,null,null)
NgGetElementById(_WMSInfoURLHolder).value=url;}}
return;}
function HandleInfoToolFrame(url){if(url==null){url=NgGetElementById(_InfoURLHolder).value;}
if(typeof window.g_GMAPCurrentView!='undefined'&&window.g_GMAPCurrentView==JsMapView.EARTH)
{CreateInfoBalloon(url);return;}
if(NgGetElementById(_InfoLayer)!=null){ShowLayer(_InfoLayer,null,null);if(url!=null){PopulateiFrame(_InfoiFrame,url,null,null)
NgGetElementById(_InfoURLHolder).value=url;}}
return;}
function HandleLegendFrame(url){if(url==null){url=NGServerUrl()+"/Webpages/Map/Legend.aspx";}
try{if(NgGetElementById(_LegendLayer)!=null){ShowLayer(_LegendLayer,null,null);PopulateiFrame(_LegendiFrame,url,null,null);}}catch(e){}}
function HandlePrintFrame(url){if(url==null)
url=NgGetElementById(_PrintURLHolder).value;if(NgGetElementById(_PrintLayer)!=null)
ShowLayer(_PrintLayer,null,null);if(url!=null){if(NgGetElementById(_PrintiFrame)!=null){PopulateiFrame(_PrintiFrame,url,null,null);NgGetElementById(_PrintURLHolder).value=url;}}
return;}
function HandleOverviewMapFrame(url){try{if(url==null){if(window.NGServerUrl){url=NGServerUrl()+"/WebPages/Map/OverviewMap.aspx";}
else{url=appBasePath+"/WebPages/Map/OverviewMap.aspx";}}
if(NgGetElementById(_MapOverViewLayer)!=null){ShowLayer(_MapOverViewLayer,null,null);if(NgGetElementById(_MapOverViewiFrame)!=null){PopulateiFrame(_MapOverViewiFrame,url,null,null);}}}catch(e){}
return;}
function HandlePluginToolsFrame(url){try{if(url==null){if(window.NGServerUrl){url=NGServerUrl();}
else{url=appBasePath;}}
if(NgGetElementById(_PlugInMapToolsLayer)!=null){ShowLayer(_PlugInMapToolsLayer,null,null);if(NgGetElementById(_PlugInMapToolsiFrame)!=null){PopulateiFrame(_PlugInMapToolsiFrame,url,null,null);}}}catch(e){}
return;}
function HandleAttributeEditerFrame(url){if(NgGetElementById(_AttributeEditorLayer)!=null){ShowLayer(_AttributeEditorLayer,null,null);if(url==null)
url=NgGetElementById(_AttributeEditorURLHolder).value;if(url!=null){PopulateiFrame(_AttributeeditoriFrame,url,null,null);NgGetElementById(_AttributeEditorURLHolder).value=url;}}
return;}
function HandleThemeFrame(url){if(NgGetElementById(_ThemeLayer)!=null){ShowLayer(_ThemeLayer,null,null);if(url==null)
url=NgGetElementById(_ThemeURLHolder).value;if(url!=null){PopulateiFrame(_ThemeiFrame,url,null,null);NgGetElementById(_ThemeURLHolder).value=url;}}
return;}
function HandleTMDBSearchFrame(url){if(NgGetElementById(_TMDBSearchLayer)!=null){ShowLayer(_TMDBSearchLayer,null,null);if(url==null)
url=NgGetElementById(_TMDBSearchURLHolder).value;if(url!=null){PopulateiFrame(_TMDBSearchiFrame,url,null,null);NgGetElementById(_TMDBSearchURLHolder).value=url;}}
return;}
function HandleManageThemeFrame(url){if(NgGetElementById(_ManageThemeLayer)!=null){ShowLayer(_ManageThemeLayer,null,null);if(url==null)
url=NgGetElementById(_ManageThemeURLHolder).value;if(url!=null){PopulateiFrame(_ManageThemeiFrame,url,null,null);NgGetElementById(_ManageThemeURLHolder).value=url;}}
return;}
function HandleManageTaskFrame(url){var elemt=NgGetElementById(_ManageTask);if(elemt!=null){if(url==null)
url=NgGetElementById(_ManageTaskURLHolder).value;if(url!=null){PopulateiFrame(_ManageTaskiFrame,url,null,null);NgGetElementById(_ManageTaskURLHolder).value=url;}
elemt.style.display="block"
xZIndex(elemt,highZ++)}
return;}
function HandleNewJobFrame(url){var _box=window.top.NgGetElementById(window.top._NewTask);if(_box!=null){_box.style.display='block';_box.style.visibility='visible';}
if(NgGetElementById(_NewTask)!=null){ShowLayer(_NewTask,null,null);if(url==null){url=NgGetElementById(_NewTaskURLHolder).value;}
if(url!=null){url=url+'&command=false';PopulateiFrame(_NewTaskiFrame,url,null,null);NgGetElementById(_NewTaskURLHolder).value=url;}}
return;}
function HandleJobStatusFrame(url){var _box=window.top.NgGetElementById(window.top._TaskStatus);if(_box!=null){_box.style.display='block';_box.style.visibility='visible';}
if(NgGetElementById(_TaskStatus)!=null){ShowLayer(_TaskStatus,null,null);if(url==null)
url=NgGetElementById(_TaskStatusURLHolder).value;if(url!=null){PopulateiFrame(_TaskStatusiFrame,url,null,null);NgGetElementById(_TaskStatusURLHolder).value=url;}}
return;}
function HandleCommandNewJobFrame(url){var _box=window.top.NgGetElementById(window.top._NewTask);if(_box!=null){_box.style.display='block';_box.style.visibility='visible';}
if(NgGetElementById(_NewTask)!=null){ShowLayer(_NewTask,null,null);if(url==null)
url=NgGetElementById(_NewTaskURLHolder).value;if(url!=null){url=url+'&command=true';PopulateiFrame(_NewTaskiFrame,url,null,null);NgGetElementById(_NewTaskURLHolder).value=url;}}
return;}
function HandleTMSymbolEditorFrame(url){var frame=NgGetElementById(_TMSymbolEditor);if(frame!=null){ShowLayer(_TMSymbolEditor,null,null);frame.style.visibility='visible';if(url==null)
url=NgGetElementById(_TMSymbolEditorURLHolder).value;if(url!=null){PopulateiFrame(_TMSymbolEditoriFrame,url,null,null);NgGetElementById(_TMSymbolEditorURLHolder).value=url;}}
return;}
function HandleTMColorSchemeFrame(url){var frame=NgGetElementById(_TMColorScheme);if(frame!=null){ShowLayer(_TMColorScheme,null,null);frame.style.visibility='visible';if(url==null)
url=NgGetElementById(_TMColorSchemeURLHolder).value;if(url!=null){PopulateiFrame(_TMColorSchemeiFrame,url,null,null);NgGetElementById(_TMColorSchemeURLHolder).value=url;}}
return;}
function HandleReportsFrame(url){if(NgGetElementById(_ReportsLayer)!=null){ShowLayer(_ReportsLayer,null,null);if(url==null){url=NgGetElementById(_ReportsURLHolder).value;}
if(url!=null){PopulateiFrame(_ReportsiFrame,url,null,null);NgGetElementById(_ReportsURLHolder).value=url;}}
return;}
function HandleSearchFrame(url){if(NgGetElementById(_SearchControlLayer)!=null){ShowLayer(_SearchControlLayer,null,null);if(url==null){url=NgGetElementById(_SearchControlURLHolder).value;}
if(url!=null){PopulateiFrame(_SearchControliFrame,url,null,null);NgGetElementById(_SearchControlURLHolder).value=url;}}
return;}
function HandleSearchFrameClosed(searchFrameName){try{if(window.frames[searchFrameName].m_hasMapControl){UpdatePanel('Map');}}
catch(e){}
if(window.HideMapLookUp)
HideMapLookUp();if(window.HideOptionsPanel)
{HideOptionsPanel('SearchOptions');}}
function PopulateiFrame(iFrameId,url,iWidth,iHeight){var _iFrame;try{_iFrame=NgGetElementById(iFrameId);}
catch(e){}
if(_iFrame!=null){_iFrame.style.display='block';_iFrame.style.visibility='visible';_iFrame.src=url;try{if(iHeight!=null)
_iFrame.height=iHeight;if(iWidth!=null)
_iFrame.width=iWidth;}
catch(e){}}}
function CleariFrame(iFrameId){var _iFrame;try{_iFrame=NgGetElementById(iFrameId);}catch(e){}
if(_iFrame!=null){window.top.frames[iFrameId].location.href='about:blank';_iFrame.style.display='none';_iFrame.style.visibility='hidden'}}
function calcHeight(iFrameId){var the_height=document.getElementById(iFrameId).contentWindow.document.body.scrollHeight+'px';document.getElementById(iFrameId).height=the_height;document.getElementById(iFrameId).style.height=the_height;}
function calcWidth(iFrameId){var the_width=document.getElementById(iFrameId).contentWindow.document.body.scrollWidth+'px';document.getElementById(iFrameId).width=the_width;document.getElementById(iFrameId).style.width=the_width;}
function CollapseExpand(LayerToShow,imageElem){var visible=ToggleLyrVisibility(LayerToShow);if(visible){imageElem.src=imageElem.getAttribute('collapseimage');}
else{imageElem.src=imageElem.getAttribute('expandimage');if(LayerToShow.toString().search('BoxSearchCtr')>0){if(window.HideMapLookUp)
HideMapLookUp();}}
if(window.HideOptionsPanel)
{HideOptionsPanel('SearchOptions');}}
function HideElementByTime(elem,time){var the_timeout=setTimeout("HideLayer("+elem+",null,null);",time);return;}
function ResetiFrames(iFrameId,url){if(url==null){url=NGServerUrl()+'/Webpages/Loading.aspx';}
try{if(NgGetElementById(iFrameId)!=null){PopulateiFrame(iFrameId,url,null,null);}}catch(e){}}
function HidePopupWindow(commoniFrame,commoniFrameWraper){if(commoniFrame!=null&&commoniFrameWraper!=null){var _iFrame;try{_iFrame=window.top.NgGetElementById(commoniFrame);}catch(e){}
if(commoniFrameWraper!=null){var _iFrameLayer;try{_iFrameLayer=window.top.NgGetElementById(commoniFrameWraper);}catch(e){}
if(_iFrameLayer!=null){HideLayer(commoniFrameWraper,null,null);}}
if(_iFrame!=null){_iFrame.style.display='none';HideLayer(commoniFrame,null,null);_iFrame.setAttribute('isLoaded','false');window.top.frames[commoniFrame].location.href='about:blank';}}}
function HandleSessionExpired(){if(sessionExpired!=false&&!g_sessionConfirmed){var expiredMsg="Your current session has expired. Do not use the Back button on your browser. You can restart the browser and repen the web site or click OK to start a new session.";if(window.sessionExpiredMessage!=null){expiredMsg=sessionExpiredMessage;}
jQuery:jConfirm(expiredMsg,_alertWindowTitle,window._OKText,window._CancelText,function(r){if(r){PageMethods.RenewSession(HandleRenewSession);}});g_sessionConfirmed=true;}}
function HandleRenewSession(){sessionExpired=false;RefreshPage();}
function VerifySessionExpired(){if(window.parent!=null&&window!=window.parent&&window.parent.sessionExpired!=null)
sessionExpired=window.parent.sessionExpired;else
PageMethods.CheckSessionExpiry(VSE);}
function VSE(value){if(value)
sessionExpired=true;}
function AbandonSession(){if(!g_appInternalTransfer){var url="/WebPages/Abandon.aspx";if(window.NGServerUrl){url=NGServerUrl()+url;}
else{url=appBasePath+url;}
var loc="width=10,height=10,left=2000,top=2000,titlebar=no,toolbar=no,menubar=no,location=no,status=no";window.open(url,"onpoint_abandon_session",loc,true);}
else{g_appInternalTransfer=false;}}
function HandleMoreSearchLink(){try{var d1=document.getElementById('MoreSearchPan');var d2=document.getElementById('MoreSearchesDiv');if(d1!=null&&d2!=null){d2.innerHTML=d2.innerHTML+d1.innerHTML;d1.style.display='none';}
else if(d2!=null){d2.style.display='none';}}catch(e){}}
function HandleRetriveSelectionFrame(url){if(NgGetElementById(_RetriveSelectionLayer)!=null){ShowLayer(_RetriveSelectionLayer,null,null);if(url==null){url=NgGetElementById(_RetriveSelectionURLHolder).value;}
if(url!=null){NgGetElementById(_RetriveSelectionLayer).style.visibility='visible';PopulateiFrame(_RetriveSelectionIframe,url,null,null);NgGetElementById(_RetriveSelectionURLHolder).value=url;}}
return;}
function HandleSaveSelectionFrame(url,evt){if(NgGetElementById(_SaveSelectionLayer)!=null){var boxElem=document.getElementById(_SaveSelectionLayer);if(boxElem!=null){var iebody=(document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body;var dsoctop=document.all?iebody.scrollTop:pageYOffset;var dimensions=GetBrowserDimensions();var height=parseInt(boxElem.clientHeight);var width=parseInt(boxElem.clientWidth);var browserHt=dsoctop;var browserWd=0;if(dimensions!=null){browserHt=dsoctop+dimensions.height;browserWd=dimensions.width;}
getClientMouseXXYY(evt);var top=__clientMouseYY;if((__clientMouseYY+height)>browserHt){top=__clientMouseYY-height;}
var left=__clientMouseXX;if(width==0){width=200;}
if((__clientMouseXX+width)>browserWd){left=__clientMouseXX-width-50;}
boxElem.style.top=top+"px";boxElem.style.left=left+"px";}
ShowLayer(_SaveSelectionLayer,null,null);if(url==null){url=NgGetElementById(_SaveURLHolder).value;}
if(url!=null){PopulateiFrame(_SaveSelectionIframe,url,null,null);NgGetElementById(_SaveURLHolder).value=url;}}
return;}
function HandleAppendSelectionFrame(url){if(NgGetElementById(_AppendSelectionLayer)!=null){ShowLayer(_AppendSelectionLayer,null,null);if(url==null){url=NgGetElementById(_AppendURLHolder).value;}
if(url!=null){PopulateiFrame(_AppendSelectionIframe,url,null,null);NgGetElementById(_AppendURLHolder).value=url;}}
return;}
function HandleGenerateUrlFrame(url){if(NgGetElementById(_GenerateUrlLayer)!=null){ShowLayer(_GenerateUrlLayer,null,null);if(url==null){url=NgGetElementById(_GenerateUrlURLHolder).value;}
if(url!=null){PopulateiFrame(_GenerateUrlIframe,url,null,null);NgGetElementById(_GenerateUrlURLHolder).value=url;}}
return;}
function HandleDocumentViewerFrame(url){if(NgGetElementById(_DocumentViewerLayer)!=null){ShowLayer(_DocumentViewerLayer,null,null);if(url==null){url=NgGetElementById(_DocumentViewerURLHolder).value;}
if(url!=null){PopulateiFrame(_DocumentViewerIframe,url,null,null);NgGetElementById(_DocumentViewerURLHolder).value=url;}}
return;}
function HideSearchWindow(){HidePopupWindow(_SearchIframe,_SearchLayer);}
function HideSearchWindowonToolClick(){if(typeof _closeScript!='undefined'){if(_closeScript=='false'){return;}}
HideSearchWindow();}
function HandleSearch(SearchId){var url;if(SearchId==null){url=NGServerUrl()+"/Webpages/Search/SearchPopup.aspx"}
else{url=NGServerUrl()+"/Webpages/Search/SearchPopup.aspx?SEARCHID="+SearchId}
try{if(NgGetElementById(_SearchLayer)!=null){ShowLayer(_SearchLayer,null,null);NgGetElementById(_SearchLayer).style.visibility='visible';PopulateiFrame(_SearchIframe,url,null,null);UpdatePanel('SearchOptions');}}catch(e){}}
function SetSearchDialogHeaderText(elem,searchId){if(elem!=null){var dlgHeaderTxtElem=NgGetElementById(_SearchLayer+"_Text");if(dlgHeaderTxtElem!=null){if(elem.searchName){dlgHeaderTxtElem.innerText=elem.searchName;dlgHeaderTxtElem.innerHTML=elem.searchName;}
else{dlgHeaderTxtElem.innerText=elem;dlgHeaderTxtElem.innerHTML=elem;}}}
HandleSearch(searchId);}
function ClearThematicMappingTheme(){if(!sessionExpired){if(PageMethods&&PageMethods.ApplyTheme){try{PageMethods.ClearSecuredThematicMapCache();}
catch(e){alert('ExceptionHandler::ClearThematicMappingTheme '+e.message);}}}
else{HandleSessionExpired();}}
function RefreshManageThemeFrame(){var manageThemeWin=document.getElementById(_ManageThemeLayer);if(manageThemeWin!=null){if(manageThemeWin.style.display!="none"){var manageThemeFrame=window.frames[_ManageThemeiFrame];if(manageThemeFrame&&manageThemeFrame.RefreshManageThemeCtrl){manageThemeFrame.RefreshManageThemeCtrl();}}}}
function ToogleFundyNearbySearchPopup(){var showFundySearch=true;if(window.isSearchResultBtnVisible!=undefined){if(!isSearchResultBtnVisible){showFundySearch=false;ShowNearbySearchWindow();}}
if(showFundySearch){var url=NGServerUrl()+"/Webpages/Search/FundySearch.aspx?CLEARSELECTIONS=true&NEARBYSEARCHMODE=true&DisplayMode=SearchList";var iframeElem=document.getElementById(_SearchIframe);if(iframeElem!=null){iframeElem.setAttribute('isLoaded','false');}
ShowFundySearchPage(url);}}
function ToggleFundySearchPopup(displayMode){if(typeof displayMode!='undefined'){var url=NGServerUrl()+"/Webpages/Search/FundySearch.aspx?CLEARSELECTIONS=true&DisplayMode="+displayMode;}
else{var url=NGServerUrl()+"/Webpages/Search/FundySearch.aspx";}
ShowFundySearchPage(url);}
function ShowFundySearchPage(url){try{if(NgGetElementById(_SearchLayer)!=null){if(NgGetElementById(_SearchLayer).style.display=="none"){var iframeElem=document.getElementById(_SearchIframe);var eleWidth=null;var eleHeight=null;if(iframeElem.getAttribute('OriginalWidth')!=null&&typeof iframeElem.getAttribute('OriginalWidth')!='undefined')
eleWidth=iframeElem.getAttribute('OriginalWidth');else if(document.getElementById(_SearchLayer)!=null&&document.getElementById(_SearchLayer).getAttribute('OriginalWidth')!=null)
eleWidth=document.getElementById(_SearchLayer).getAttribute('OriginalWidth');if(iframeElem.getAttribute('OriginalHeight')!=null&&typeof iframeElem.getAttribute('OriginalHeight')!='undefined')
eleHeight=iframeElem.getAttribute('OriginalHeight');else if(document.getElementById(_SearchLayer)!=null&&document.getElementById(_SearchLayer).getAttribute('OriginalHeight')!=null)
eleHeight=document.getElementById(_SearchLayer).getAttribute('OriginalHeight');ResizeIFrame(_SearchIframe,eleWidth,eleHeight);ShowLayer(_SearchLayer,null,null);iframeElem.setAttribute('isLoaded','true');PopulateiFrame(_SearchIframe,url,null,null);}
else{HideLayer(_SearchLayer,null,null);}}}catch(e){}}
function ShowFundyLayer(source,layerID){var layer=document.getElementById(layerID);if(layer&&layer.style&&layer.style.display=='none'){HideFundyRSMapToolAllWindows(source);ShowLayer(layerID,null,null);}}
function HideFundyRSMapToolAllWindows(source){var searchBtnVisible=false;if(window._isSearchResultsVisible!=undefined){searchBtnVisible=window._isSearchResultsVisible;}
switch(source){case"mapcontent":{if(searchBtnVisible)
HideLayer(_SearchLayer,null,null);HideLayer(_BoxOptions,null,null);HideLayer(_LegendLayer,null,null);HideLayer(_ShoppingCartLayer,null,null);HideLayer(_ECommerceAccountLayer,null,null);}
break;case"search":{HideLayer(_LayerManager,null,null);HideLayer(_BoxOptions,null,null);HideLayer(_ShoppingCartLayer,null,null);HideLayer(_ECommerceAccountLayer,null,null);}
break;case"options":{HideLayer(_LayerManager,null,null);if(searchBtnVisible)
HideLayer(_SearchLayer,null,null);HideLayer(_LegendLayer,null,null);HideLayer(_ShoppingCartLayer,null,null);HideLayer(_ECommerceAccountLayer,null,null);}
break;case"legend":{HideLayer(_LayerManager,null,null);HideLayer(_ShoppingCartLayer,null,null);HideLayer(_ECommerceAccountLayer,null,null);}
break;case"cart":{HideLayer(_LayerManager,null,null);if(searchBtnVisible)
HideLayer(_SearchLayer,null,null);HideLayer(_BoxOptions,null,null);HideLayer(_LegendLayer,null,null);HideLayer(_ECommerceAccountLayer,null,null);}
break;case"account":{HideLayer(_LayerManager,null,null);if(searchBtnVisible)
HideLayer(_SearchLayer,null,null);HideLayer(_BoxOptions,null,null);HideLayer(_LegendLayer,null,null);HideLayer(_ShoppingCartLayer,null,null);}
break;}}
function toggleLegend(){if(NgGetElementById(_LegendLayer)!=null){if(NgGetElementById(_LegendLayer).style.display=="none"){doLegend();}
else{NgGetElementById(_LegendLayer).style.display="none";}}}
function AddEmbeddedMapTools(divId){if(divId!=null&&window.g_rsMapToolsDiv){if(document.getElementById("g_outerRSMapToolsDiv")==null){var mapDiv=document.getElementById(divId);var top=getElementTopPostion(mapDiv);var g_outerRSMapToolsDiv=document.createElement("div");g_outerRSMapToolsDiv.id="g_outerRSMapToolsDiv";if(window.htmlDir=="RTL"){g_outerRSMapToolsDiv.className="embeddedMapToolsDivLeft";}
else{g_outerRSMapToolsDiv.className="embeddedMapToolsDiv";}
g_outerRSMapToolsDiv.appendChild(g_rsMapToolsDiv);document.body.appendChild(g_outerRSMapToolsDiv);g_outerRSMapToolsDiv.style.top=top+"px";}}}
function AlignWorkWithMapBox(alignToDivId){var targetDiv=NgGetElementById(alignToDivId);if(targetDiv!=null){var targetTop=getElementTopPostion(targetDiv);var advToolsDiv=NgGetElementById(_AdvancedTools);if(advToolsDiv!=null){advToolsDiv.style.top=targetTop+'px';var boxEle=GetBoxItem(_AdvancedTools);if(boxEle!=null&&boxEle.isCachedValue==false){boxEle.originalTop=targetTop;boxEle.isCachedValue=true;}}
AlignRSMapToolWindowPosition(alignToDivId);}}
function ToogleOptions(){HideFundyRSMapToolAllWindows("options");var divOptions=_BoxOptions;if(NgGetElementById(divOptions)!=null){var divElem=NgGetElementById(divOptions);if(divElem.style.display=="none"){divElem.style.display="block";if(typeof window.g_GMAPCurrentView!='undefined'&&(window.g_GMAPCurrentView==JsMapView.EARTH||window.g_GMAPCurrentView==JsMapView.STREET))
{divElem.style.top=(NgGetElementById('divHeaderBars').offsetTop-divElem.offsetHeight)+"px";divElem.style.left=(document.body.offsetWidth-divElem.offsetWidth)+"px";}}
else{divElem.style.display="none";}}}
function AlignRSMapToolWindowPosition(alignToDivId){var targetDiv=NgGetElementById(alignToDivId);if(targetDiv!=null){var top=getElementTopPostion(targetDiv);if(NgGetElementById(_LayerManager)!=null){var boxEle=GetBoxItem(_LayerManager);if(boxEle!=null&&boxEle.isCachedValue==false){boxEle.isCachedValue=true;NgGetElementById(_LayerManager).style.top=top+"px";boxEle.originalTop=top;}}
if(NgGetElementById(_SearchLayer)!=null){var boxEle=GetBoxItem(_SearchLayer);if(boxEle!=null&&boxEle.isCachedValue==false){boxEle.isCachedValue=true;NgGetElementById(_SearchLayer).style.top=top+"px";boxEle.originalTop=top;}}
if(NgGetElementById(_BoxOptions)!=null){var boxEle=GetBoxItem(_BoxOptions);if(boxEle!=null&&boxEle.isCachedValue==false){boxEle.isCachedValue=true;NgGetElementById(_BoxOptions).style.top=top+"px";boxEle.originalTop=top;}}
if(NgGetElementById(_ShoppingCartLayer)!=null){var boxEle=GetBoxItem(_ShoppingCartLayer);if(boxEle!=null&&boxEle.isCachedValue==false){boxEle.isCachedValue=true;NgGetElementById(_ShoppingCartLayer).style.top=top+"px";boxEle.originalTop=top;}}
if(NgGetElementById(_ECommerceAccountLayer)!=null){var boxEle=GetBoxItem(_ECommerceAccountLayer);if(boxEle!=null&&boxEle.isCachedValue==false){boxEle.isCachedValue=true;NgGetElementById(_ECommerceAccountLayer).style.top=top+"px";boxEle.originalTop=top;}}}}
function SetMapContainerHeight(){var mapCtrlId=null;var mapCtrl=GetMapCtrl(mapCtrlId);var onPointSetting=GetOnPointSettings(mapCtrlId);if(onPointSetting!=null&&onPointSetting.dynamicMapResizingEnabled){var newMapSize=GetDynamicMapSize(mapCtrlId);var tblContainer=NgGetElementById('tblMapContainer');if(tblContainer!=null){Console.debug("tblMapContainer::'"+tblContainer.height+"':: mapHeight:"+newMapSize.height);tblContainer.height=newMapSize.height-15+"px";}}}
function HideFundyLayerOptionWindows(){if(document.getElementById("tblDashboard")!=null){HideLayer(_LayerManager,null,null);HideLayer(_BoxOptions,null,null);}}
function ToggleSelections(){try{if(NgGetElementById(_SearchListContainer)!=null){if(NgGetElementById(_SearchListContainer).style.display=="none"){ShowLayer(_SearchListContainer,null,null);}
else{HideLayer(_SearchListContainer,null,null);}}
else{if(window._msgNoSelectionResults){jQuery:jAlert(window._msgNoSelectionResults,window._AlertWindowTitle,window._OKText,'warning',function(r)
{});}
else{jQuery:jAlert(window._msgNoSelectionResults,window._AlertWindowTitle,window._OKText,'warning',function(r)
{});}}}catch(e){}}
function ShowResult(response){if(response){ShowSearchWindow()}
else{if(window._msgNoSelectionResults){jQuery:jAlert(window._msgNoSelectionResults,window._AlertWindowTitle,window._OKText,'warning',function(r)
{});}
else{jQuery:jAlert(window._msgNoSelectionResults,window._AlertWindowTitle,window._OKText,'warning',function(r)
{});}}}
function CloseSearchWindow(){if(g_searchLaunchedFromSelections){HideSearchWindow();g_searchLaunchedFromSelections=false;}
else{HideLayer(_SearchLayer,null,null);}}
function HandleSearchBySearchName(SearchName,useResultsAsFilterToLayerId,filterResultsByLayerId){var url;var date_object=new Date();if(SearchName==null){url=NGServerUrl()+"/Webpages/Search/SearchPopup.aspx?uniqueid="+date_object.getTime();}
else{url=NGServerUrl()+"/Webpages/Search/SearchPopup.aspx?SEARCHNAME="+encodeURI(SearchName)+"&uniqueid="+date_object.getTime();}
if(useResultsAsFilterToLayerId&&useResultsAsFilterToLayerId>0){window.top.ScrollToMap();url=url+"&USERESULTSASFILTERTO="+useResultsAsFilterToLayerId;}
if(filterResultsByLayerId&&filterResultsByLayerId>0){window.top.ScrollToMap();url=url+"&FILTERRESULTSBY="+filterResultsByLayerId;}
try{if(NgGetElementById(_SearchLayer)!=null){PopulateiFrame(_SearchIframe,url,null,null);UpdatePanel('SearchOptions');}}catch(e){}}
function SetSearchDialogHeaderTextBySearchName(searchName,useResultsAsFilterToLayerId,filterResultsByLayerId){ResetSearchWindow(false);ShowLoading();HideLayer(_SearchLayer,null,null)
if(searchName!=null){var dlgHeaderTxtElem=NgGetElementById(_SearchLayer+"_Text");if(dlgHeaderTxtElem!=null){dlgHeaderTxtElem.innerText=searchName;dlgHeaderTxtElem.innerHTML=searchName;}}
g_searchLaunchedFromSelections=true;HandleSearchBySearchName(searchName,useResultsAsFilterToLayerId,filterResultsByLayerId);}
function ResetSearchWindow(minimize){var innerRowElem=NgGetElementById("Inner_"+_SearchLayer);var imgElem=NgGetElementById(_SearchLayer+"tglImg");if(innerRowElem!=null&&imgElem!=null){if(!minimize){innerRowElem.style.display="none";}
CollapseExpand("Inner_"+_SearchLayer,imgElem);}}
function ResizeIFrame(frameId,bWidth,bHeight){var _iFrame;try{_iFrame=NgGetElementById(frameId);}
catch(e){}
if(_iFrame!=null){if(bWidth){_iFrame.style.width=bWidth+"px";_iFrame.width=bWidth+"px";}
if(bHeight){_iFrame.style.height=bHeight+"px";_iFrame.height=bHeight+"px";}}}
function ShowSearchWindow(){ShowLayer(_SearchLayer,null,null);if(NgGetElementById(_SearchLayer)!=null){NgGetElementById(_SearchLayer).style.visibility='visible';}
HideLoading();}
function DisplayDashboardMenu(divID,show){try{var menuDiv=document.getElementById(divID);if(menuDiv){if(show=='true'){if(menuDiv.style.visibility=='hidden'){menuDiv.style.visibility="visible";}}
else if(show=='false'){menuDiv.style.visibility="hidden";}}}
catch(e){}}
function OpenContextHelp(id,culture){if(id=='SEARCH'){var searchName=NgGetElementById(_SearchLayer+"_Text");if(searchName){id=id+"_"+searchName.innerText;id=encodeURI(id);}}
window.open('~/HelpHandler.ashx?CMD=SHOW&ID='+id+'&CULTURE='+culture+'','','width=990, height=675, toolbar=no, status=yes, menubar=no ,resizable=yes,scrollbars=yes');if(window.PageMethods)
PageMethods.LogHelpActivity(id);}
function DisplayHelpToolTip(divID,show){try{var menuDiv=document.getElementById(divID);if(menuDiv){if(show=='true'){menuDiv.style.display="";}
else{menuDiv.style.display="none";}}}
catch(e){}}
function replaceNGPopupHelpID(commonPopupLayer,helpId,culture){var elename=commonPopupLayer+"_ContextHelpImg";var element=window.top.NgGetElementById(elename);if(element){element.onclick=function(){OpenContextHelp(helpId,culture);}}
var divElement=window.top.NgGetElementById(commonPopupLayer+"_divContextHelpImg");if(divElement){divElement.style.display="";}}
function toggleMoreSelectionToolsWindow(elementID){toggleLayer(elementID);xZIndex(elementID,1000);}
function IsSearchContainerVisible(){var visible=false;var innerRowElem=NgGetElementById("Inner_"+_SearchLayer);if(innerRowElem!=null){if(innerRowElem.style.display!="none"){visible=true;}}
return visible;}
function HandleSearchLinks(){var url;url=NGServerUrl()+"/Webpages/Search/FundySearch.aspx?SEARCH=NearbySearches"
try{if(NgGetElementById(_SearchLayer)!=null){ShowLayer(_SearchLayer,null,null);NgGetElementById(_SearchLayer).style.visibility='visible';PopulateiFrame(_SearchIframe,url,null,null);}}catch(e){}}
function HandleSearchLinksBySearchName(searchName){var url;url=NGServerUrl()+"/Webpages/Search/FundySearch.aspx?SEARCH=NearbySearches&SEARCHNAME="+searchName
try{if(NgGetElementById(_SearchLayer)!=null){ShowLayer(_SearchLayer,null,null);NgGetElementById(_SearchLayer).style.visibility='visible';PopulateiFrame(_SearchIframe,url,null,null);}}catch(e){}}
var prevSelectionDisplayStyle;function ResizeSelectionList(elemId,resetWidthOnly){var isSelectionVisible=false;var ctrlSelections=document.getElementById(elemId);if(ctrlSelections!=null){prevSelectionDisplayStyle=ctrlSelections.style.display;if(ctrlSelections.style.display=="block"){isSelectionVisible=true;ctrlSelections.style.display="none";}}
if(isSelectionVisible)
window.setTimeout("ResizeOnLoad('"+elemId+"');",500);}
function ResizeOnLoad(elemId,resetWidthOnly){var ctrlSelections=document.getElementById(elemId);Resize(elemId);if(ctrlSelections!=null){ctrlSelections.style.display=prevSelectionDisplayStyle;}}
function Resize(elemId,resetWidthOnly){var onPointSetting=GetOnPointSettings();var ctrlSelections=document.getElementById(elemId);var box=GetBoxItem(elemId);if(ctrlSelections!=null&&onPointSetting!=null){var pgHt=getElementDimensions("footer");var divElem=document.getElementById("selResults");var prevWidth=(divElem!=null?divElem.style.width:0);var mapDims=GetDynamicMapSize();if(prevWidth!=(mapDims.width+"px")&&(divElem!=null)){if(!isIE){resetWidthOnly=false;}
ctrlSelections.style.left="4px";if(!resetWidthOnly){SetSelectionListControlCache(elemId);}
divElem.style.width=mapDims.width+'px';}
ctrlSelections.style.top=(pgHt.Top-1)+"px";}}
function SetSelectionListControlCache(elemId){var box=GetBoxItem(elemId);if(box!=null){var pgHt=getElementDimensions("footer");if(pgHt!=null){box.top=(pgHt.Top-1);box.left="4";box.originalLeft="4";box.originalTop=(pgHt.Top-1);}}
else{var pgHt=getElementDimensions("footer");if(pgHt!=null){var boxProp=new BoxProperty(elemId,"none","4",(pgHt.Top-1),"4",(pgHt.Top-1),null,null,null,null);boxProp.PersistLocation();AddBoxItem(boxProp);}}}
function ResetFooterPosition(eleId){var elem=document.getElementById(eleId);var elemBtmPos=0;if(elem!=null&&(elem.style.display=="block")){elemBtmPos=elem.scrollHeight+getElementTopPostion(elem);}
else{Console.debug('element not found');}
var divFooter=document.getElementById("footer");var tbl=document.getElementById('trElement');if(divFooter!=null&&tbl!=null){var pgHt=getElementTopPostion(divFooter);var scrollHeight=getScrollHeight()+16;if(IsScrollBarsAvailable()){scrollHeight="0";}
if(elemBtmPos>pgHt){scrollHeight=(elemBtmPos-pgHt);}
else{scrollHeight="0";}
Console.debug('ResetFooterPosition :- scrollHeight: '+scrollHeight+', clientHeight :'+document.documentElement.clientHeight+', documentElement.scrollHeight:'+document.documentElement.scrollHeight);tbl.style.height=scrollHeight+'px';}}
function IsScrollBarsAvailable(){var exists=false;if(document.documentElement&&(document.documentElement.scrollHeight&&document.documentElement.clientHeight)){exists=(document.documentElement.scrollHeight<document.documentElement.clientHeight);}
else if(document.body&&(document.body.clientHeight&&document.body.scrollHeight)){exists=(document.body.scrollHeight<document.body.clientHeight);}
return exists;}
function getScrollHeight(){var broswerHeight=0;if(document.documentElement&&(document.documentElement.clientHeight)){broswerHeight=document.documentElement.scrollHeight-document.documentElement.clientHeight;}
else if(document.body&&(document.body.clientHeight&&document.body.scrollHeight)){broswerHeight=document.body.scrollHeight-document.body.clientHeight;}
return broswerHeight;}
function SetMapContainerParentElemSize(){var elem=document.getElementById('tblMapContainer');if(elem!=null){elem.style.height="";if(parseInt(elem.style.height)!=elem.clientHeight){elem.style.height=elem.clientHeight+"px";}}}
function ShowLayerManager(lyrElemId){var elem=document.getElementById(lyrElemId);if(elem!=null&&elem.style.display=="none"){var lyrJSObj=_GetLM(m_layerMgrTree);if(lyrJSObj!=null){lyrJSObj.Refresh();}}
toggleLayer(lyrElemId);}
function ShowContextHelp(e,url,container){_HideToolHelp();if(window.top!=null){if(window.top.m_contextHelpTip==null){OPAddEventListener(document,"click",HideContextHelp);}
window.top._ShowContextHelp(e,url,container);}
else{_ShowContextHelp(e,url,container);}}
var mousePos={xMousePos:0,yMousePos:0,xMousePosMax:0,yMousePosMax:0};function GetHelpTipDisplayPos(){if(document.layers){document.captureEvents(Event.MOUSEMOVE);document.onmousemove=captureMousePosition;}else if(document.all){document.onmousemove=captureMousePosition;}else if(document.getElementById){document.onmousemove=captureMousePosition;}}
function captureMousePosition(e){if(document.layers){mousePos.xMousePos=e.pageX;mousePos.yMousePos=e.pageY;mousePos.xMousePosMax=window.innerWidth+window.pageXOffset;mousePos.yMousePosMax=window.innerHeight+window.pageYOffset;}else if(document.all){mousePos.xMousePos=window.event.x+document.body.scrollLeft;mousePos.yMousePos=window.event.y+document.body.scrollTop;mousePos.xMousePosMax=document.body.clientWidth+document.body.scrollLeft;mousePos.yMousePosMax=document.body.clientHeight+document.body.scrollTop;}else if(document.getElementById){mousePos.xMousePos=e.pageX;mousePos.yMousePos=e.pageY;mousePos.xMousePosMax=window.innerWidth+window.pageXOffset;mousePos.yMousePosMax=window.innerHeight+window.pageYOffset;}}
function _ShowContextHelp(e,url,containerId){StopEvent(e);var mapTipObj=eval("maptipObject");if(mapTipObj!=null){var eventCloned=OpenLayers.Util.extend({},e);GetHelpTipDisplayPos();if(containerId=="SEARCH"){var isIE=(window.navigator.appName.toLowerCase().indexOf("microsoft")>=0)
var searchPopDims=getElementDimensions(_SearchLayer);var searchPopHeaderDims=getElementDimensions("header_"+_SearchLayer);if(isIE==true){mousePos.xMousePos-=20;if(parseInt(mousePos.xMousePos)==0||parseInt(mousePos.xMousePos)<0){mousePos.xMousePos=e.clientX+searchPopDims.Left+searchPopHeaderDims.Left;}
eventCloned.clientX=mousePos.xMousePos;eventCloned.clientY=e.clientY+searchPopDims.Top+searchPopHeaderDims.Height+40;}
else{eventCloned.pageX=e.pageX+searchPopDims.Left+searchPopHeaderDims.Left;eventCloned.pageY=e.pageY+searchPopDims.Top+searchPopHeaderDims.Height;}}
CreateContextHelpBallon(eventCloned,mapTipObj);m_contextHelpTip.showTooltip(eventCloned,"<div  class='contextHelpTipIFrame'><table border='0' cellspacing='0' cellpadding='0' ><tr><td>"+m_contextCloseHtml+"</td></tr><tr><td><iframe src='"+url+"' width='100%' height='100%'></iframe></td></tr></table></div>",1);}}
var m_contextHelpTip=null;var m_contextCloseHtml="";function CreateContextHelpBallon(evt,mapTipObj,showLoading){tooltipEvt=evt;if(mapTipObj!=null){if(!m_contextHelpTip){m_contextHelpTip=new Balloon;BalloonConfig(m_contextHelpTip,'GBox');m_contextHelpTip.padding=5;m_contextHelpTip.shadow=0;m_contextHelpTip.stemHeight=20;m_contextHelpTip.stemOverlap=1;m_contextHelpTip.images=getServerProtocol()+mapTipObj.ImagePath;m_contextHelpTip.vOffset=-3;m_contextHelpTip.hOffset=-8;m_contextHelpTip.balloonImage='balloon.png';m_contextHelpTip.upLeftStem='up_left.png';m_contextHelpTip.upRightStem='up_right.png';m_contextHelpTip.downLeftStem='down_left.png';m_contextHelpTip.downRightStem='down_right.png';m_contextHelpTip.ieImage=null;m_contextHelpTip.delayTime=1;m_contextHelpTip.allowEventHandlers=true;m_contextHelpTip.opacity=1;var dir="style = 'text-align:right;'";if((document.all&&!window.opera)&&htmlDir&&htmlDir=='RTL')
dir="style = 'text-align:left;'";m_contextCloseHtml="<div id='TipCloseDiv' "+dir+">";m_contextCloseHtml+="<img style='cursor:pointer;' onclick='HideContextHelp();' src='"+m_contextHelpTip.images+"/close.gif'>";m_contextCloseHtml+="</div>";OPAddEventListener(document,"click",HideContextHelp);}
if(m_contextHelpTip){m_contextHelpTip.hideTooltip(true);}}}
function HideContextHelp(){try{if(window.top!=null){if(window.top.m_contextHelpTip){window.top.m_contextHelpTip.hideTooltip(true);}}
else{if(m_contextHelpTip){m_contextHelpTip.hideTooltip(true);}}}
catch(ex){}}
function ToggleToolStatus(toolName,status){var tool=FindTool(toolName);if(tool!=null){if(status)
tool.Enable();else
tool.Disable();}}
function HandleNearbySearchWindow(searchName){var path="/Webpages/Search/NearbySearchPopup.aspx?CLEARSELECTIONS=true&SEARCHNAME="+encodeURI(searchName);if(window.NGServerUrl){path=NGServerUrl()+path;}
else{var protocol=window.location.protocol;var theHost=window.location.hostname;var port=window.location.port;if(port){port=":"+port;}
var ThePath=window.location.pathname;ThePath=ThePath.substring(0,ThePath.indexOf("/",1));path=protocol+"//"+theHost+port+ThePath+path;}
var searchUrl=path;if(window.HandleNearbySearchFrame){HandleNearbySearchFrame(searchUrl);}
else{window.open(searchUrl,"NearbySearchWindow","toolbar=no, directories=no, location=no,status=yes, menubar=no, resizable=yes, scrollbars=auto, width=550, height=500");}}
function SetOriginalDims(){var searchdiv=document.getElementById(_SearchLayer);if(searchdiv!=null){var dims=getElementDimensions(_SearchLayer);if(typeof searchdiv.getAttribute('OriginalWidth')=='undefined'||searchdiv.getAttribute('OriginalWidth')==null)
searchdiv.setAttribute("OriginalWidth",dims.Width);if(typeof searchdiv.getAttribute('OriginalHeight')=='undefined'||searchdiv.getAttribute('OriginalHeight')==null)
searchdiv.setAttribute("OriginalHeight",dims.Height);}}
function ResizeAttributeEditorWindow(){var tbl=document.getElementById('cntrTable');if(tbl&&window.top&&window.top.AdjustAttributeEditorSize){var rect=tbl.getBoundingClientRect();window.top.AdjustAttributeEditorSize(rect.right-rect.left+80,rect.bottom-rect.top+65);}}
function HandleMapSnapshotWindow(url){if(url==null)
url=NgGetElementById(_MapSnapshotURLHolder).value;if(NgGetElementById(_MapSnapshotLayer)!=null)
ShowLayer(_MapSnapshotLayer,null,null);if(url!=null){if(NgGetElementById(_MapSnapshotiFrame)!=null){PopulateiFrame(_MapSnapshotiFrame,url,null,null);NgGetElementById(_MapSnapshotURLHolder).value=url;}}
AdjustMapSnapshotSize(300,120);return;}
function AdjustMapSnapshotSize(width,height){var iframe=NgGetElementById(_MapSnapshotiFrame);if(iframe!=null){var oBody=iframe.contentWindow.document.body;if(navigator.userAgent.toLowerCase().indexOf('chrome')>-1||navigator.userAgent.toLowerCase().indexOf('firefox')>-1)
height+=30;iframe.style.height=height+"px";iframe.style.width=width+"px";var container=NgGetElementById(_MapLookUpDivId);container.style.height=height+"px";container.style.width=width+"px";var containerLeft=parseInt(container.style.left);var containerTop=parseInt(container.style.top);var pageWidth=YAHOO.util.Dom.getViewportWidth();var pageHeight=YAHOO.util.Dom.getViewportHeight();if(containerTop+height>pageHeight)
container.style.top=Math.max((pageHeight-height-20),0)+"px";if(containerLeft+width>pageWidth)
container.style.left=Math.max((pageWidth-width-5),0)+"px";}}
function HandleSaveSelectionAsKMZWindow(url){ShowLoading();HideLayer(_BoxSelectionTools,null,null);if(url==null)
url=NgGetElementById(_SaveAsKMZHolder).value;if(url!=null){if(NgGetElementById(_SaveSelectionAsKMZIframe)!=null){PopulateiFrame(_SaveSelectionAsKMZIframe,url,null,null);NgGetElementById(_SaveAsKMZHolder).value=url;}}
return;}
var currentBalloonClass;var balloonIsVisible;var balloonIsSticky;var balloonInvisibleSelects;var balloonIsSuppressed;var tooltipIsSuppressed;var mouseOverContents=false;var Balloon=function(){this.trackCursor=true;this.stopTrackingX=100;this.stopTrackingY=50;document.onscroll=Balloon.prototype.hideTooltip;window.onbeforeunload=function(){Balloon.prototype.hideTooltip(1);balloonIsSuppressed=true;};if(this.isIE()){this.suppress=true;}
return this;}
Balloon.prototype.showTooltip=function(evt,caption,sticky,width,height){if(!this.configured){BalloonConfig(this,'GBubble');}
if(this.isIE()&&document.readyState.match(/complete/i)){this.suppress=false;}
if(this.suppress){return false;}
if(tooltipIsSuppressed&&!sticky){return false;}
if(this.opacity&&this.opacity<1){this.opacity=parseInt(parseFloat(this.opacity)*100);}
else if(this.opacity&&this.opacity==1){this.opacity=100;}
else if(!this.opacity){this.opacity==100;}
if(this.isKonqueror()){this.allowFade=false;this.opacity=100;}
if(this.isIE()&&this.allowFade){this.opacity=100;}
var mouseOver=evt.type.match('mouseover','i');if(!mouseOver){sticky=true;this.fadeOK=false;}
else{this.fadeOK=this.allowFade;}
if(balloonIsVisible&&!balloonIsSticky&&mouseOver){return false;}
if(balloonIsVisible&&balloonIsSticky&&!sticky){return false;}
var el=this.getEventTarget(evt);if(sticky&&mouseOver&&this.isSameElement(el,this.currentElement)){return false;}
this.firingElement=el;if(sticky)this.hideTooltip(1);var closeBalloon=function(){var override=balloonIsSticky&&!balloonIsVisible;Balloon.prototype.hideTooltip(override)}
if(el){if(!mouseOver){el.onmouseup=function(){return false};}}
balloonIsSticky=sticky;this.hideTooltip();this.currentHelpText=this.getAndCheckContents(caption);if(!this.currentHelpText){return false;}
this.width=width;this.height=height;this.actualWidth=null;this.cleanup();this.container=document.createElement('div');this.container.id='container';document.body.appendChild(this.container);this.setStyle(this.container,'position','absolute');this.setStyle(this.container,'top',-8888);this.setStyle(this.container,'font-family',this.fontFamily);this.setStyle(this.container,'font-size',this.fontSize);this.currentHelpText=this.currentHelpText.replace(/\&amp;/g,'&amp;amp');this.container.innerHTML=unescape(this.currentHelpText);if(this.images){this.balloonImage=this.balloonImage?this.images+'/'+this.balloonImage:false;this.ieImage=this.ieImage?this.images+'/'+this.ieImage:false;this.upLeftStem=this.upLeftStem?this.images+'/'+this.upLeftStem:false;this.upRightStem=this.upRightStem?this.images+'/'+this.upRightStem:false;this.downLeftStem=this.downLeftStem?this.images+'/'+this.downLeftStem:false;this.downRightStem=this.downRightStem?this.images+'/'+this.downRightStem:false;this.closeButton=this.closeButton?this.images+'/'+this.closeButton:false;this.images=false;}
if(this.ieImage&&(this.isIE()||this.isChrome())){if(this.isOldIE()||this.opacity||this.allowFade){this.balloonImage=this.ieImage;}}
if(!this.preloadedImages){var images=new Array(this.balloonImage,this.closeButton);if(this.ieImage){images.push(this.ieImage);}
if(this.stem){images.push(this.upLeftStem,this.upRightStem,this.downLeftStem,this.downRightStem);}
var len=images.length;for(var i=0;i<len;i++){if(images[i]){this.preload(images[i]);}}
this.preloadedImages=true;}
currentBalloonClass=this;if(!mouseOver){this.setActiveCoordinates(evt);}
this.currentEvent=evt;evt.cancelBubble=true;var delay=mouseOver?this.delayTime:1;var images=this.container.getElementsByTagName("img");var deferred=false;for(var i=0,len=images.length;i<len;i++){var img=images[i];if(this.isIE()){if(!img.readyState.match(/complete/i)){img.onreadystatechange=this.imageLoad;deferred=true;}}
else if(!img.complete){delay=500;break;}}
if(!deferred){this.timeoutTooltip=window.setTimeout(this.doShowTooltip,delay);}
this.pending=true;}
Balloon.prototype.imageLoad=function(){var self=currentBalloonClass;var images=self.container.getElementsByTagName("img");for(var i=0,len=images.length;i<len;i++){var img=images[i];if(!img.readyState.match(/complete/i)){return;}}
self.doShowTooltip();}
Balloon.prototype.preload=function(src){var i=new Image;i.src=src;this.setStyle(i,'position','absolute');this.setStyle(i,'top',-8000);document.body.appendChild(i);document.body.removeChild(i);}
Balloon.prototype.doShowTooltip=function(){var self=currentBalloonClass;if(balloonIsVisible)return false;if(!self.parent){if(self.parentID){self.parent=document.getElementById(self.parentID);}
else{self.parent=document.body;}
self.xOffset=self.getLoc(self.parent,'x1');self.yOffset=self.getLoc(self.parent,'y1');}
window.clearTimeout(self.timeoutFade);self.setStyle('balloon','display','none');self.parseIntAll();var balloon=self.makeBalloon();var pageWidth=YAHOO.util.Dom.getViewportWidth();var pageCen=Math.round(pageWidth/2);var pageHeight=YAHOO.util.Dom.getViewportHeight();var pageLeft=YAHOO.util.Dom.getDocumentScrollLeft();var pageTop=YAHOO.util.Dom.getDocumentScrollTop();var pageMid=pageTop+Math.round(pageHeight/2);self.pageBottom=pageTop+pageHeight;self.pageTop=pageTop;self.pageLeft=pageLeft;self.pageRight=pageLeft+pageWidth;if(!(self.activeTop&&self.activeRight)){}
var vOrient=self.activeTop>pageMid?'up':'down';var hOrient=self.activeRight>pageCen?'left':'right';var helpText=self.container.innerHTML;self.actualWidth=self.getLoc(self.container,'width')+20;try{self.parent.removeChild(self.container);}
catch(e){Console.error(String.format('{0}::{1}| Error - {2}','JS/Dev/baloon.js','doShowTooltip',e.message));}
var wrapper=document.createElement('div');wrapper.id='contentWrapper';wrapper.onmousemove=function(){mouseOverContents=true;};wrapper.onmouseout=function(){mouseOverContents=false;};self.contents.appendChild(wrapper);wrapper.innerHTML=helpText;self.setBalloonStyle(vOrient,hOrient,pageWidth,pageLeft);if(balloonIsSticky){}
balloonIsVisible=true;self.pending=false;self.showHide();self.startX=self.activeLeft;self.startY=self.activeTop;self.fade(0,self.opacity,self.fadeIn);}
Balloon.prototype.addCloseButton=function(){var self=currentBalloonClass;var margin=Math.round(self.padding/2);var closeWidth=self.closeButtonWidth||16;var balloonTop=self.getLoc('balloon','y1')+margin+self.shadow;var BalloonLeft=self.getLoc('topRight','x2')-self.closeButtonWidth-self.shadow-margin;var closeButton=document.getElementById('closeButton');if(!closeButton){closeButton=new Image;closeButton.setAttribute('id','closeButton');closeButton.setAttribute('src',self.closeButton);closeButton.onclick=function(){Balloon.prototype.hideTooltip(1);};self.setStyle(closeButton,'position','absolute');document.body.appendChild(closeButton);}
if(self.isIE()){BalloonLeft=BalloonLeft-5;}
self.setStyle(closeButton,'top',balloonTop);self.setStyle(closeButton,'left',BalloonLeft);self.setStyle(closeButton,'display','inline');self.setStyle(closeButton,'cursor','pointer');self.setStyle(closeButton,'z-index',999999999);}
Balloon.prototype.makeBalloon=function(){var self=currentBalloonClass;var balloon=document.getElementById('balloon');if(balloon){self.cleanup();}
balloon=document.createElement('div');balloon.setAttribute('id','balloon');self.parent.appendChild(balloon);self.activeBalloon=balloon;self.parts=new Array();var parts=new Array('contents','topRight','bottomRight','bottomLeft');for(var i=0;i<parts.length;i++){var child=document.createElement('div');child.setAttribute('id',parts[i]);balloon.appendChild(child);if(parts[i]=='contents')self.contents=child;self.parts.push(child);}
if(self.displayTime){self.timeoutAutoClose=window.setTimeout(this.autoHide,self.displayTime);}
return balloon;}
Balloon.prototype.setBalloonStyle=function(vOrient,hOrient,pageWidth,pageLeft){var self=currentBalloonClass;var balloon=self.activeBalloon;if(typeof(self.shadow)!='number')self.shadow=0;if(!self.stem)self.stemHeight=0;var fullPadding=self.padding+self.shadow;var insidePadding=self.padding;var outerWidth=self.actualWidth+fullPadding;var innerWidth=self.actualWidth;self.setStyle(balloon,'position','absolute');self.setStyle(balloon,'top',-9999);self.setStyle(balloon,'z-index',1000000);if(self.height){self.setStyle('contentWrapper','height',self.height-fullPadding);}
if(self.width){self.setStyle(balloon,'width',self.width);innerWidth=self.width-fullPadding;if(balloonIsSticky){}
self.setStyle('contentWrapper','width',innerWidth);}
else{self.setStyle(balloon,'width',outerWidth);self.setStyle('contentWrapper','width',innerWidth);}
if(!self.width&&self.maxWidth&&outerWidth>self.maxWidth){self.setStyle(balloon,'width',self.maxWidth);self.setStyle('contentWrapper','width',self.maxWidth-fullPadding);}
if(!self.width&&self.minWidth&&outerWidth<self.minWidth){self.setStyle(balloon,'width',self.minWidth);self.setStyle('contentWrapper','width',self.minWidth-fullPadding);}
self.setStyle('contents','z-index',2);self.setStyle('contents','color',self.fontColor);self.setStyle('contents','font-family',self.fontFamily);self.setStyle('contents','font-size',self.fontSize);self.setStyle('contents','background','url('+self.balloonImage+') top left no-repeat');self.setStyle('contents','padding-top',fullPadding);self.setStyle('contents','padding-left',fullPadding);self.setStyle('bottomRight','background','url('+self.balloonImage+') bottom right no-repeat');self.setStyle('bottomRight','position','absolute');self.setStyle('bottomRight','right',0-fullPadding);self.setStyle('bottomRight','bottom',0-fullPadding);self.setStyle('bottomRight','height',fullPadding);self.setStyle('bottomRight','width',fullPadding);self.setStyle('bottomRight','z-index',-1);self.setStyle('topRight','background','url('+self.balloonImage+') top right no-repeat');self.setStyle('topRight','position','absolute');self.setStyle('topRight','right',0-fullPadding);self.setStyle('topRight','top',0);self.setStyle('topRight','width',fullPadding);self.setStyle('bottomLeft','background','url('+self.balloonImage+') bottom left no-repeat');self.setStyle('bottomLeft','position','absolute');self.setStyle('bottomLeft','left',0);self.setStyle('bottomLeft','bottom',0-fullPadding);self.setStyle('bottomLeft','height',fullPadding);self.setStyle('bottomLeft','z-index',-1);if(this.stem){var stem=document.createElement('img');self.setStyle(stem,'position','absolute');balloon.appendChild(stem);if(vOrient=='up'&&hOrient=='left'){stem.src=self.upLeftStem;var height=self.stemHeight+insidePadding-self.stemOverlap;self.setStyle(stem,'bottom',0-height);self.setStyle(stem,'right',0);}
else if(vOrient=='down'&&hOrient=='left'){stem.src=self.downLeftStem;var height=self.stemHeight-(self.shadow+self.stemOverlap);self.setStyle(stem,'top',0-height);self.setStyle(stem,'right',0);}
else if(vOrient=='up'&&hOrient=='right'){stem.src=self.upRightStem;var height=self.stemHeight+insidePadding-self.stemOverlap;self.setStyle(stem,'bottom',0-height);self.setStyle(stem,'left',self.shadow);}
else if(vOrient=='down'&&hOrient=='right'){stem.src=self.downRightStem;var height=self.stemHeight-(self.shadow+self.stemOverlap);self.setStyle(stem,'top',0-height);self.setStyle(stem,'left',self.shadow);}
if(self.fadeOK&&self.isIE()){self.parts.push(stem);}}
if(self.allowFade){self.setOpacity(1);}
else if(self.opacity){self.setOpacity(self.opacity);}
if(hOrient=='left'){var pageWidth=self.pageRight-self.pageLeft;var activeRight=pageWidth-self.activeLeft;self.setStyle(balloon,'right',activeRight);}
else{var activeLeft=self.activeRight-self.xOffset;self.setStyle(balloon,'left',activeLeft);}
var overflow=balloonIsSticky?'auto':'hidden';self.setStyle('contentWrapper','overflow',overflow);if(balloonIsSticky){}
var balloonLeft=self.getLoc(balloon,'x1');var balloonRight=self.getLoc(balloon,'x2');var scrollBar=20;if(hOrient=='right'&&balloonRight>(self.pageRight-fullPadding)){var width=(self.pageRight-balloonLeft)-fullPadding-scrollBar;self.setStyle(balloon,'width',width);self.setStyle('contentWrapper','width',width-fullPadding);}
else if(hOrient=='left'&&balloonLeft<(self.pageLeft+fullPadding)){var width=(balloonRight-self.pageLeft)-fullPadding;self.setStyle(balloon,'width',width);self.setStyle('contentWrapper','width',width-fullPadding);}
var balloonWidth=self.getLoc(balloon,'width');var balloonHeight=self.getLoc(balloon,'height');var vOverlap=self.isOverlap('topRight','bottomRight');var hOverlap=self.isOverlap('bottomLeft','bottomRight');if(vOverlap){self.setStyle('topRight','height',balloonHeight-vOverlap[1]);}
if(hOverlap){self.setStyle('bottomLeft','width',balloonWidth-hOverlap[0]);}
if(vOrient=='up'){var activeTop=self.activeTop-balloonHeight;self.setStyle(balloon,'top',activeTop);}
else{var activeTop=self.activeBottom;self.setStyle(balloon,'top',activeTop);}
var balloonTop=self.getLoc(balloon,'y1');var balloonBottom=self.height?balloonTop+self.height:self.getLoc(balloon,'y2');var deltaTop=balloonTop<self.pageTop?self.pageTop-balloonTop:0;var deltaBottom=balloonBottom>self.pageBottom?balloonBottom-self.pageBottom:0;if(vOrient=='up'&&deltaTop){var newHeight=balloonHeight-deltaTop;if(newHeight>(self.padding*2)){self.setStyle('contentWrapper','height',newHeight-fullPadding);self.setStyle(balloon,'top',self.pageTop+self.padding);self.setStyle(balloon,'height',newHeight);}}
if(vOrient=='down'&&deltaBottom){var newHeight=balloonHeight-deltaBottom-scrollBar;if(newHeight>(self.padding*2)+scrollBar){self.setStyle('contentWrapper','height',newHeight-fullPadding);self.setStyle(balloon,'height',newHeight);}}
var iframe=balloon.getElementsByTagName('iframe');if(iframe[0]){iframe=iframe[0];var w=self.getLoc('contentWrapper','width');if(balloonIsSticky&&!this.isIE()){w-=self.closeButtonWidth;}
var h=self.getLoc('contentWrapper','height');self.setStyle(iframe,'width',w);self.setStyle(iframe,'height',h);self.setStyle('contentWrapper','overflow','hidden');}
self.setStyle('topRight','height',self.getLoc(balloon,'height'));self.setStyle('bottomLeft','width',self.getLoc(balloon,'width'));self.hOrient=hOrient;self.vOrient=vOrient;}
Balloon.prototype.fade=function(opacStart,opacEnd,millisec){var self=currentBalloonClass||new Balloon;if(!millisec||!self.allowFade){return false;}
opacEnd=opacEnd||100;var speed=Math.round(millisec/100);var timer=0;for(o=opacStart;o<=opacEnd;o++){self.timeoutFade=setTimeout('Balloon.prototype.setOpacity('+o+')',(timer*speed));timer++;}}
Balloon.prototype.setOpacity=function(opc){var self=currentBalloonClass;if(!self||!opc)return false;var o=parseFloat(opc/100);var parts=self.isIE()?self.parts:[self.activeBalloon];var len=parts.length;for(var i=0;i<len;i++){self.doOpacity(o,opc,parts[i]);}}
Balloon.prototype.doOpacity=function(op,opc,el){var self=currentBalloonClass;if(!el)return false;self.setStyle(el,'opacity',op);self.setStyle(el,'filter','alpha(opacity='+opc+')');self.setStyle(el,'MozOpacity',op);self.setStyle(el,'KhtmlOpacity',op);}
Balloon.prototype.autoHide=function(){var self=currentBalloonClass;if(!mouseOverContents){Balloon.prototype.showHide(1);Balloon.prototype.cleanup();if(self){window.clearTimeout(self.timeoutTooltip);window.clearTimeout(self.timeoutFade);window.clearTimeout(self.timeoutAutoClose);if(balloonIsSticky){self.currentElement=null;}
self.startX=0;self.startY=0;}
balloonIsVisible=false;balloonIsSticky=false;}
else{window.setTimeout(self.autoHide,self.displayTime);}}
Balloon.prototype.hideTooltip=function(override){if(override&&typeof override=='object')override=false;if(balloonIsSticky&&!override)return false;var self=currentBalloonClass;Balloon.prototype.showHide(1);Balloon.prototype.cleanup();if(self){window.clearTimeout(self.timeoutTooltip);window.clearTimeout(self.timeoutFade);window.clearTimeout(self.timeoutAutoClose);if(balloonIsSticky){self.currentElement=null;}
self.startX=0;self.startY=0;}
balloonIsVisible=false;balloonIsSticky=false;}
Balloon.prototype.cleanup=function(){var self=currentBalloonClass;var body;if(self){body=self.parent?self.parent:self.parentID?document.getElementById(self.parentID)||document.body:document.body;}
else{body=document.body;}
var bubble=document.getElementById('balloon');var close=document.getElementById('closeButton');var cont=document.getElementById('container');if(bubble){body.removeChild(bubble)}
if(close){body.removeChild(close)}
if(cont){body.removeChild(cont)}}
hideAllTooltips=function(){var self=currentBalloonClass;if(!self)return;window.clearTimeout(self.timeoutTooltip);if(self.activeBalloon)self.setStyle(self.activeBalloon,'display','none');balloonIsVisible=false;balloonIsSticky=false;currentBalloonClass=null;}
Balloon.prototype.setActiveCoordinates=function(evt){var self=currentBalloonClass;if(!self){return true;}
var evt=evt||window.event||self.currentEvent;if(!evt){return true;}
self.hOffset=self.hOffset||1;self.vOffset=self.vOffset||1;self.stemHeight=self.stem&&self.stemHeight?(self.stemHeight||0):0;var scrollTop=0;var scrollLeft=0;var XY=self.eventXY(evt);adjustment=self.hOffset<20?10:0;self.activeTop=scrollTop+XY[1]-adjustment-self.vOffset-self.stemHeight;self.activeLeft=scrollLeft+XY[0]-adjustment-self.hOffset;self.activeRight=scrollLeft+XY[0];self.activeBottom=scrollTop+XY[1]+self.vOffset+2*adjustment;if(balloonIsVisible&&!balloonIsSticky&&self.trackCursor){var deltaX=Math.abs(self.activeLeft-self.startX);var deltaY=Math.abs(self.activeTop-self.startY);if(deltaX>self.stopTrackingX||deltaY>self.stopTrackingY){self.hideTooltip();}
else{var b=self.activeBalloon;var bwidth=self.getLoc(b,'width');var bheight=self.getLoc(b,'height');var btop=self.getLoc(b,'y1');var bleft=self.getLoc(b,'x1');if(self.hOrient=='right'){self.setStyle(b,'left',self.activeRight);}
else if(self.hOrient=='left'){self.setStyle(b,'right',null);var newLeft=self.activeLeft-bwidth;self.setStyle(b,'left',newLeft);}
if(self.vOrient=='up'){self.setStyle(b,'top',self.activeTop-bheight);}
else if(self.vOrient=='down'){self.setStyle(b,'top',self.activeBottom);}}}
return true;}
Balloon.prototype.eventXY=function(event){var XY=new Array(2);var e=event||window.event;if(!e){return false;}
if(e.pageX||e.pageY){XY[0]=e.pageX;XY[1]=e.pageY;}
else if(e.clientX||e.clientY){XY[0]=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;XY[1]=e.clientY+document.body.scrollTop+document.documentElement.scrollTop;}
return XY;}
Balloon.prototype.getEventTarget=function(event){var targ;var e=event||window.event;if(e.target)targ=e.target;else if(e.srcElement)targ=e.srcElement;if(targ&&targ.nodeType&&targ.nodeType==3)targ=targ.parentNode;return targ;}
Balloon.prototype.setStyle=function(el,att,val){if(!el){return false;}
if(typeof(el)!='object'){el=document.getElementById(el);}
if(!el){return false;}
if(val&&att.match(/left|top|bottom|right|width|height|padding|margin/)){val=new String(val);if(!val.match(/auto/)){val+='px';}}
if(att=='z-index'){if(el.style){el.style.zIndex=parseInt(val);}}
else{YAHOO.util.Dom.setStyle(el,att,val);}}
Balloon.prototype.getLoc=function(el,request){var region=YAHOO.util.Dom.getRegion(el);switch(request){case('y1'):return parseInt(region.top);case('y2'):return parseInt(region.bottom);case('x1'):return parseInt(region.left);case('x2'):return parseInt(region.right);case('width'):return(parseInt(region.right)-parseInt(region.left));case('height'):return(parseInt(region.bottom)-parseInt(region.top));case('region'):return region;}
return region;}
Balloon.prototype.parseIntAll=function(){this.padding=parseInt(this.padding);this.shadow=parseInt(this.shadow);this.stemHeight=parseInt(this.stemHeight);this.stemOverlap=parseInt(this.stemOverlap);this.vOffset=parseInt(this.vOffset);this.delayTime=parseInt(this.delayTime);this.width=parseInt(this.width);this.maxWidth=parseInt(this.maxWidth);this.minWidth=parseInt(this.minWidth);this.fadeIn=parseInt(this.fadeIn)||1000;}
Balloon.prototype.showHide=function(visible){var self=currentBalloonClass||new Balloon;if(self.isOldIE()){var balloonContents=document.getElementById('contentWrapper');if(!visible&&balloonContents){var balloonSelects=balloonContents.getElementsByTagName('select');var myHash=new Object();for(var i=0;i<balloonSelects.length;i++){var id=balloonSelects[i].id||balloonSelects[i].name;myHash[id]=1;}
balloonInvisibleSelects=new Array();var allSelects=document.getElementsByTagName('select');for(var i=0;i<allSelects.length;i++){var id=allSelects[i].id||allSelects[i].name;if(self.isOverlap(allSelects[i],self.activeBalloon)&&!myHash[id]){balloonInvisibleSelects.push(allSelects[i]);self.setStyle(allSelects[i],'visibility','hidden');}}}
else if(balloonInvisibleSelects){for(var i=0;i<balloonInvisibleSelects.length;i++){var id=balloonInvisibleSelects[i].id||balloonInvisibleSelects[i].name;self.setStyle(balloonInvisibleSelects[i],'visibility','visible');}
balloonInvisibleSelects=null;}}
if(self.hide){var display=visible?'inline':'none';for(var n=0;n<self.hide.length;n++){if(self.isOverlap(self.activeBalloon,self.hide[n])){self.setStyle(self.hide[n],'display',display);}}}}
Balloon.prototype.isOverlap=function(el1,el2){if(!el1||!el2)return false;var R1=this.getLoc(el1,'region');var R2=this.getLoc(el2,'region');if(!R1||!R2)return false;var intersect=R1.intersect(R2);if(intersect){intersect=new Array((intersect.right-intersect.left),(intersect.bottom-intersect.top));}
return intersect;}
Balloon.prototype.isSameElement=function(el1,el2){if(!el1||!el2)return false;var R1=this.getLoc(el1,'region');var R2=this.getLoc(el2,'region');var same=R1.contains(R2)&&R2.contains(R1);return same?true:false;}
Balloon.prototype.getAndCheckContents=function(caption){var originalCaption=caption;var notAllowed='are not allowed in popup balloons in this web site.  \
Please contact the site administrator for assistance.';var notSupported='AJAX is not supported for popup balloons in this web site.  \
Please contact the site administrator for assistance.';if(this.helpUrl&&!this.allowAJAX){alert('Sorry, you have specified help URL '+this.helpUrl+' but '+notSupported);return null;}
if(caption.match(/^url:/)){this.activeUrl=caption.replace(/^url:/,'');caption='';}
else if(caption.match(/^(https?:|\/|ftp:)\S+$/i)){this.activeUrl=caption;caption='';}
if(this.activeUrl&&!this.allowAJAX){alert('Sorry, you asked for '+originalCaption+' but '+notSupported);return null;}
if(caption.match(/^load:/)){var load=caption.split(':');if(!document.getElementById(load[1]))alert('problem locating element '+load[1]);caption=document.getElementById(load[1]).innerHTML;this.loadedFromElement=true;}
if(caption.match(/\<\s*iframe/i)&&!this.allowIframes){alert('Sorry: iframe elements '+notAllowed);return null;}
if(caption.match(/\bon(load|mouse|click|unload|before)[^=]*=/i)&&!this.allowEventHandlers){alert('Sorry: JavaScript event handlers '+notAllowed);return null;}
if(caption.match(/\<\s*script/i)&&!this.allowScripts){alert('Sorry: <script> elements '+notAllowed);return null;}
this.currentHelpText=this.getContents(caption);this.loadedFromElement=false;return this.currentHelpText;;}
Balloon.prototype.getContents=function(section){if(!this.helpUrl&&!this.activeUrl)return section;if(this.loadedFromElement)return section;var url=this.activeUrl||this.helpUrl;url+=this.activeUrl?'':'?section='+section;this.activeUrl=null;var ajax;if(window.XMLHttpRequest){ajax=new XMLHttpRequest();}else{ajax=new ActiveXObject("Microsoft.XMLHTTP");}
if(ajax){ajax.open("GET",url,false);ajax.onreadystatechange=function(){};try{ajax.send(null);}
catch(e){}
var txt=this.escapeHTML?escape(ajax.responseText):ajax.responseText;return txt||section;}
else{return section;}}
Balloon.prototype.isIE=function(){return document.all&&!window.opera;}
Balloon.prototype.isOldIE=function(){if(navigator.appVersion.indexOf("MSIE")==-1)return false;var temp=navigator.appVersion.split("MSIE");return parseFloat(temp[1])<7;}
Balloon.prototype.isKonqueror=function(){return navigator.userAgent.toLowerCase().indexOf('konqueror')!=-1;}
Balloon.prototype.isChrome=function(){return navigator.userAgent.toLowerCase().indexOf('chrome')>-1;}
function CheckBoxClicked(checkElemId,hidElemId,delimeter)
{if(checkElemId!=null&&hidElemId!=null&&delimeter!=null)
{var checkElem=document.getElementById(checkElemId);var hidElem=document.getElementById(hidElemId);if(checkElem!=null&&hidElem!=null)
{var value=checkElem.value;if(checkElem.checked)
{if(hidElem.value.length>0)
{hidElem.value+=delimeter;}
hidElem.value+=value;}
else
{var hidValue=hidElem.value;var arr=hidValue.split(delimeter);newhidValue="";for(j=0;j<arr.length;j++)
{if(arr[j]!=""&&arr[j]!=value)
{newhidValue+=arr[j]+delimeter;}}
if(newhidValue!=""&&newhidValue.length>0)
{newhidValue=newhidValue.substring(0,newhidValue.length-1);}
hidElem.value=newhidValue;}}}}
function selectedElemClicked(selectElemId,hidElemId,delimeter)
{if(selectElemId!=null&&hidElemId!=null&&delimeter!=null)
{var selectElem=document.getElementById(selectElemId);var hidElem=document.getElementById(hidElemId);if(selectElem!=null&&hidElem!=null)
{if(selectElem.multiple)
{var selectedElem="";selectElem.blur();selectElem.focus();for(i=0;i<selectElem.length;i++)
{if(selectElem.options[i].selected)
{selectedElem+=selectElem.options[i].value+delimeter;}}
if(selectedElem!=""&&selectedElem.length>0)
{selectedElem=selectedElem.substring(0,selectedElem.length-1);}
hidElem.value=selectedElem;}
else
{hidElem.value=selectElem.value;}}}}
function CombineAllLinkClicked(hidElemId,mode)
{hidElem=document.getElementById(hidElemId);if(hidElem!=null)
{hidElem.value=mode;}}
function checkboxClicked(currchkElem,selElemId,checkAllElemId,checkElemId,start,end,selectionsetId)
{AddToHiddenElement(currchkElem,selElemId);checkAllElem=document.getElementById(checkAllElemId);startIndex=parseInt(start);endIndex=parseInt(end);if(startIndex!="NaN"&&endIndex!="NaN"&&checkAllElem!=null)
{for(i=startIndex;i<=endIndex;i++)
{checkSelectedElem=document.getElementById(checkElemId+i);if(checkSelectedElem!=null)
{checkAllElem.checked=checkSelectedElem.checked;if(!checkSelectedElem.checked)
{break;}}}}
hidElem=document.getElementById(selElemId);if(hidElem)
PageMethods.UpdateSelectionsAndSearchResultSetMapping(selectionsetId,hidElem.value,HandleRefreshSearchWindow);}
function CheckAll(checkAllElemId,chkElemId,start,end,selElemId)
{checkAllElem=document.getElementById(checkAllElemId);startIndex=parseInt(start);endIndex=parseInt(end);if(startIndex!="NaN"&&endIndex!="NaN"&&checkAllElem!=null)
{for(i=startIndex;i<=endIndex;i++)
{checkSelectedElem=document.getElementById(chkElemId+i);if(checkSelectedElem!=null)
{checkSelectedElem.checked=checkAllElem.checked;AddToHiddenElement(checkSelectedElem,selElemId);}
else
{alert("checkSelectedElem is null - "+(chkElemId+i));}}}
if(window.__activeSelectionSetId){var selectionSetId=window.__activeSelectionSetId;hidElem=document.getElementById(selElemId);if(hidElem)
PageMethods.UpdateSelectionsAndSearchResultSetMapping(selectionSetId,hidElem.value,HandleRefreshSearchWindow);}}
function AddToHiddenElement(chkElem,hidElemId)
{hidElem=document.getElementById(hidElemId);if(chkElem!=null&&hidElem!=null)
{value=chkElem.value;var hidValue;if(chkElem.checked)
{if(hidElem.value.length>0)
{hidValue=hidElem.value;var match=hidValue.match(value);if(match==null)
hidValue=hidValue+","+value;hidElem.value=hidValue;}
else
{hidElem.value+=value;}}
else
{hidValue=hidElem.value;var prevLen=hidValue.length;var newhidValue=hidValue.replace(value+",","");var afterReplaceLen=newhidValue.length;if(prevLen==afterReplaceLen)
{newhidValue=hidValue.replace(","+value,"");}
if(hidValue==value)
newhidValue="";hidElem.value=newhidValue;}}}
function ToggleClick(chkElemId,start,end)
{startIndex=parseInt(start);endIndex=parseInt(end);for(i=startIndex;i<=endIndex;i++)
{checkSelectedElem=document.getElementById(chkElemId+i);if(checkSelectedElem!=null)
{checkSelectedElem.checked=!checkSelectedElem.checked;}}}
function ImageClick(currElemId,currentPage)
{currElem=document.getElementById(currElemId);if(currElem!=null)
{var currentValue=parseInt(currentPage);if(currentValue=="NaN")
currentValue=0;currElem.value=currentValue;}}
function toggleIndexing()
{var parentWindow;if(!sessionExpired)
{if(window.opener)
{parentWindow=window.opener;}
else
{parentWindow=window.top;}
if(parentWindow!=null&&typeof(parentWindow.showLoading)=='function')
parentWindow.showLoading();PageMethods.ToggleIndexing(toggleIndexingCallback);}
else
{HandleSessionExpired();}}
function toggleIndexingCallback(obj)
{if(obj!=null)
{RefreshMap();}}
function SelectionObject(selectionSetId,divElementId,currElemId,showNumbering,showNumberingAsHyperlink,numberHyperlinkUrl,clientID,selectedRowsClientID,tableCssClass,checkAllResourceCaption,prevButtonImageUrl,nextButtonImageUrl,selectionListContentId)
{this.SelectionListContentId=selectionListContentId;this.SelectionSetId=selectionSetId;this.DivElementId=divElementId;this.ShowNumbering=showNumbering;this.CurrentElementId=currElemId;this.ShowNumberingAsHyperlink=showNumberingAsHyperlink;this.NumberHyperlinkUrl=numberHyperlinkUrl;this.ClientID=clientID;this.SelectedRowsClientID=selectedRowsClientID;this.TableCssClass=tableCssClass;this.CheckAllResourceCaption=checkAllResourceCaption;this.PrevButtonImageUrl=prevButtonImageUrl;this.NextButtonImageUrl=nextButtonImageUrl;}
function NavigationButtonClick(selectionSetId,currentPage)
{var obj=eval("_selObject_"+selectionSetId);if(obj!=null)
{RefreshSelectionListContent(obj,currentPage);}}
function itemAttr_onClick(eventArg,argValue)
{var formElements=document.getElementsByTagName("form");if(formElements!=null&&formElements.length>0&&formElements[0]!=null)
{formElements[0].__EVENTTARGET.value=eventArg;formElements[0].__EVENTARGUMENT.value=argValue;if(Sys.WebForms.PageRequestManager.getInstance()._postBackSettings.async==true)
{Sys.WebForms.PageRequestManager.getInstance()._onFormSubmit();}
else
{formElements[0].submit();}}}
function RefreshSelectionList(selectionSetId)
{var obj=eval("_selObject_"+selectionSetId);if(obj!=null)
{var currElem=document.getElementById(obj.CurrentElementId);if(currElem!=null)
{RefreshSelectionListContent(obj,currElem.value);}}}
function ExportButtonClicked(selectionSetId)
{if(selectionSetId!=null)
{var url='/Webpages/Reports/Reports.aspx?SELECTIONSETID='+selectionSetId;if(window.NGServerUrl)
{url=NGServerUrl()+url;}
if(window.HandleReportsFrame&&PageMethods.RefreshMaps)
{HandleReportsFrame(url);}
else
{if(window.top.HandleReportsFrame)
{window.top.HandleReportsFrame(url);}
else
{var SelectionReportWindow=window.open(url,"reportWin","toolbar=no, directories=no, location=no, status=yes, menubar=no, resizable=yes, scrollbars=yes, width=400, height=200");}}}}
function NGExpandCollapse(LayerToShow,imageElem,selectionSetId)
{var serverName=window.location.protocol+'//'+window.location.hostname;var port=window.location.port;if(port)
{serverName=serverName+":"+port;}
var collapseimage=serverName+imageElem.getAttribute('collapseimage');var expanded=true;if(String(imageElem.src)!=String(collapseimage))
{imageElem.src=imageElem.getAttribute('collapseimage');HideLayer(LayerToShow,null,null);expanded=false;}
else{imageElem.src=imageElem.getAttribute('expandimage');ShowLayer(LayerToShow,null,null);expanded=true;}
if(!sessionExpired)
{PageMethods.UpdateExpandState(selectionSetId,expanded);}
else
{HandleSessionExpired();}}
function InfoToolClicked(url)
{if(url!=null)
{if(window.HandleInfoToolFrame)
{HandleInfoToolFrame(url);}
else
{window.open(url,"InfoWindow","toolbar=no, directories=no, location=no,status=yes, menubar=no, resizable=yes, scrollbars=auto, width=550, height=500");}}
return;}
function ZoomToAllSelections()
{if(!sessionExpired)
{PageMethods.GetSelectionsEnvelope(HandleZoomEnvelope);}
else
{HandleSessionExpired();}}
function HandleZoomEnvelope(response)
{if(response!=null&&response.length>0)
{var values=response.split(",");if(values!=null&&values.length>3){var mapCtrl=g_OLMapCtrls[0];if(mapCtrl){var bounds=new OpenLayers.Bounds(parseFloat(values[0]),parseFloat(values[1]),parseFloat(values[2]),parseFloat(values[3]));mapCtrl.zoomToExtent(bounds);}}}}
function HandleZoomLatLon(response){if(response!=null&&response.length>0){if(window.g_GEPlugin){zoomToGEExtent(response);}}}
function HandleZoomToSelection(response)
{if(response!=null&&Boolean(response))
{RefreshMap();}}
function ZoomToActiveSelections()
{if(window.__activeSelectionSetId)
{var selectionSetId=window.__activeSelectionSetId;if(selectionSetId!=null)
{var selectionObject=eval("_selObject_"+selectionSetId);if(selectionObject!=null)
{if(!sessionExpired)
{var currSelected=document.getElementById(selectionObject.SelectedRowsClientID);if(currSelected!=null)
{var selectedItems=currSelected.value;var mapCtrl=g_OLMapCtrls[0];if(mapCtrl){PageMethods.GetActiveSelectionsEnvelope(selectionSetId,selectedItems,HandleZoomEnvelope);}}}
else
{HandleSessionExpired();}}}}}
function ClientExtenderClick(setId,itemId,url)
{if(url!=null)
{if(url.indexOf("http")<0)
{url=NGServerUrl()+url;}
if(url.indexOf("?")>0)
url=url+"&";else
url=url+"?";}
url=url+"setid="+setId+"&itemid="+itemId;NgOpenPopup(url,400,300,"OnPoint");}
var divElement=null;var currSelected=null;function RefreshSelectionListContent(selectionObject,currentPage)
{var selectionListObj=PageMethods;if(selectionListObj!=null&&selectionObject!=null)
{if(!sessionExpired)
{divElement=document.getElementById(selectionObject.DivElementId);if(divElement!=null)
{var currElem=document.getElementById(selectionObject.CurrentElementId);currSelected=document.getElementById(selectionObject.SelectedRowsClientID);if(currElem!=null&&currSelected!=null)
{ImageClick(selectionObject.CurrentElementId,currentPage);var currentPage=currElem.value;var selectedItems=currSelected.value;try
{selectionListObj.GetSelectionContentHtml(selectionObject.SelectionSetId,currentPage,selectionObject.ShowNumbering,selectionObject.ShowNumberingAsHyperlink,selectionObject.NumberHyperlinkUrl,selectionObject.ClientID,selectionObject.SelectedRowsClientID,selectionObject.TableCssClass,selectionObject.CheckAllResourceCaption,selectionObject.PrevButtonImageUrl,selectionObject.NextButtonImageUrl,selectionObject.CurrentElementId,selectedItems,selectionObject.SelectionListContentId,HandleSelectionNavigation);}
catch(e)
{alert(e.message);}}}}
else
{HandleSessionExpired();}}}
function HandleSelectionNavigation(response)
{if(response!=null)
{divElement.innerHTML=response.SelectionControlHTML;currSelected.value=response.SelectedItemsIds;RefreshMap();}}
function SaveSelections(e)
{HideLayer(_BoxSelectionTools,null,null);if(window.__activeSelectionSetId)
{var selectionSetId=window.__activeSelectionSetId;if(selectionSetId!=null)
{if(!sessionExpired)
{if(PageMethods.RefreshMaps)
{openSavePopup(NGServerUrl()+'/WebPages/Selections/SaveSelections.aspx');}
else if(window.top.HandleSaveSelectionFrame)
{window.top.HandleSaveSelectionFrame(NGServerUrl()+'/WebPages/Selections/SaveSelections.aspx',e);}
else
{window.open(NGServerUrl()+'/WebPages/Selections/SaveSelections.aspx',"SaveDBSelectionsWindow","toolbar=no, directories=no, location=no,status=yes, menubar=no, resizable=yes, scrollbars=auto, width=450, height=200");}}
else
{HandleSessionExpired();}}}}
function AppendSelections()
{if(window.__activeSelectionSetId)
{var selectionSetId=window.__activeSelectionSetId;if(selectionSetId!=null)
{var selectionObject=eval("_selObject_"+selectionSetId);if(selectionObject!=null)
{if(!sessionExpired)
{var currSelected=document.getElementById(selectionObject.SelectedRowsClientID);if(currSelected!=null)
{var selectedItems=currSelected.value;PageMethods.UpdateSelections(selectionSetId,selectedItems,HandleZoomToSelection);if(PageMethods.RefreshMaps)
{openAppendPopup(NGServerUrl()+'/WebPages/Selections/AppendSelections.aspx');}
else if(window.top.HandleAppendSelectionFrame)
{window.top.HandleAppendSelectionFrame(NGServerUrl()+'/WebPages/Selections/AppendSelections.aspx');}
else
{window.open(NGServerUrl()+'/WebPages/Selections/AppendSelections.aspx',"AppendSelections","toolbar=no, directories=no, location=no,status=yes, menubar=no, resizable=yes, scrollbars=auto, width=450, height=200");}}}
else
{HandleSessionExpired();}}}}}
function SetBoxPosition(imageElem,evt,boxElemId)
{if(imageElem!=null&&boxElemId!=null)
{var ele=document.getElementById(_BoxSelectionTools);var boxElem=document.getElementById(boxElemId);if(boxElem!=null)
{var iebody=(document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body;var dsoctop=document.all?iebody.scrollTop:pageYOffset;var dimensions=GetBrowserDimensions();var height=parseInt(boxElem.clientHeight);var browserHt=dsoctop;if(dimensions!=null)
{browserHt=dsoctop+dimensions.height;}
getClientMouseXXYY(evt);var top=__clientMouseYY;if((__clientMouseYY+height)>browserHt)
{top=__clientMouseYY-height;}
boxElem.style.top=top+"px";boxElem.style.left=(__clientMouseXX+5)+"px";var boxEle=GetBoxItem(boxElemId);if(boxEle!=null)
{var relayout=NgGetElementById(boxElemId+'_Relayout');if(relayout)
{boxEle.left=boxElem.style.left;boxEle.top=boxElem.style.top;}
boxEle.PersistLocation();}}}}
var __clientMouseXX;var __clientMouseYY;function getClientMouseXXYY(e)
{if(!e)
{e=window.event;}
if(e)
{if(e.pageX)
{__clientMouseXX=e.pageX;__clientMouseYY=e.pageY;}
else if(e.x)
{__clientMouseXX=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;__clientMouseYY=e.clientY+document.body.scrollTop+document.documentElement.scrollTop;}}}
function btnDBSelections_Click(searchId)
{NgOpenPopup(NGServerUrl()+'/WebPages/Selections/DBSelectionListContainer.aspx?SEARCHID='+searchId,'250','600','Database Selections')}
function ViewChartSelection()
{if(window.__activeSelectionSetId)
{var selectionSetId=window.__activeSelectionSetId;var selectionInfo='Selection,'+selectionSetId;if(!sessionExpired)
{PageMethods.ChartSelectedFeaturesForSelection(selectionSetId,HandleOpenChart);}
else
{HandleSessionExpired();}}}
function showResultPageForSelection()
{if(window.__activeSelectionSetId)
{var selectionSetId=window.__activeSelectionSetId;var selectionInfo='Selection,'+selectionSetId;PageMethods.SetSearchResult(selectionInfo,"",true,DopostbackSelection);}}
function DopostbackSelection()
{if((this.parent)&&(this.parent.frames)&&(this.parent.frames['fundySearchiFrame']))
{ShowLayer(_SearchLayer,null,null);var date_object=new Date();var url=NGServerUrl()+"/Webpages/Search/FundySearch.aspx?DISPLAYRESULTS=true&uniqueid="+date_object.getTime()
var iframeElem=document.getElementById(_SearchIframe);iframeElem.setAttribute('isLoaded','true');var eleWidth=null;var eleHeight=null;if(iframeElem.getAttribute('OriginalWidth')!=null&&typeof iframeElem.getAttribute('OriginalWidth')!='undefined')
eleWidth=iframeElem.getAttribute('OriginalWidth');else if(document.getElementById(_SearchLayer)!=null&&document.getElementById(_SearchLayer).getAttribute('OriginalWidth')!=null)
eleWidth=document.getElementById(_SearchLayer).getAttribute('OriginalWidth');if(iframeElem.getAttribute('OriginalHeight')!=null&&typeof iframeElem.getAttribute('OriginalHeight')!='undefined')
eleHeight=iframeElem.getAttribute('OriginalHeight');else if(document.getElementById(_SearchLayer)!=null&&document.getElementById(_SearchLayer).getAttribute('OriginalHeight')!=null)
eleHeight=document.getElementById(_SearchLayer).getAttribute('OriginalHeight');PopulateiFrame(_SearchIframe,url,eleWidth,eleHeight);var innerRowElem=document.getElementById("Inner_"+_SearchLayer);innerRowElem.style.display="none";ResetSearchWindow(false);}
else{UpdatePanel('Search_Result');}}
function HandleOpenChart()
{var path='/WebPages/Charting/ChartViewer.aspx';if(window.NGServerUrl)
{path=NGServerUrl()+path;}
else
{var protocol=window.location.protocol;var theHost=window.location.hostname;var port=window.location.port;if(port)
{port=":"+port;}
var ThePath=window.location.pathname;ThePath=ThePath.substring(0,ThePath.indexOf("/",1));path=protocol+"//"+theHost+port+ThePath+path;}
NgOpenPopup(path,650,514,'Chart',true);}
var reportSelectionSetId;var currentReportId;var applySelectionToReort=false;var currentSelectionGroups="";function LoadReport(selectionSetId,reportId,exportToPDF){if(exportToPDF!=undefined)
{var exportAsPDF=new Boolean(exportToPDF);var url='/Webpages/Reports/Reports.aspx?FUNCTIONALITY=SELECTIONS&SELECTIONSETID='+selectionSetId+'&REPORTID='+reportId+'&ExportAsPDF='+exportAsPDF;}
else
{var url='/Webpages/Reports/Reports.aspx?FUNCTIONALITY=SELECTIONS&SELECTIONSETID='+selectionSetId+'&REPORTID='+reportId;}
if(window.NGServerUrl){url=NGServerUrl()+url;}
var hndl=window.open(url,"reportWin_"+reportId+(window.__sessionUniqueId?__sessionUniqueId:""),"toolbar=no, directories=no, location=no, status=yes, menubar=yes, resizable=yes, scrollbars=yes");hndl.focus();window.top.OnRequestEndHandler('HideLoading();');}
function getSelectionGroup(selectionSetId)
{selectionSetId+='';var selectionGroups="";if(selectionSetId.indexOf("|")>0){var ids=selectionSetId.split('|');for(i=0;i<ids.length;i++){if(ids[i]!=null){var hidElem=document.getElementById(HIDDEN_SELECTED_FEATURE_PREFIX+ids[i]);if(hidElem!=null){if(i>0){selectionGroups+='|';}
selectionGroups+=ids[i]+'~'+hidElem.value;}}}}
else{var hidElem=document.getElementById(HIDDEN_SELECTED_FEATURE_PREFIX+selectionSetId);if(hidElem!=null){selectionGroups=selectionSetId+'~'+hidElem.value;}}
return(selectionGroups);}
function ViewSelectionSetReports(selectionSetId,reportId,exportToPDF)
{if(selectionSetId!=null&&reportId!=null)
{LoadReport(selectionSetId,reportId,exportToPDF);}}
function RemoveMultiSelectionReportLinks()
{if(!sessionExpired)
{PageMethods.RemoveMultiSelectionReportLinks(HandleRemovalOfSelectionReports);}
else
{HandleSessionExpired();}}
function HandleRemovalOfSelectionReports(response)
{if(response!=null&&Boolean(response))
{if(window._divMultiReport)
{var elem=document.getElementById(window._divMultiReport);if(elem!=null)
{elem.style.display="none";}}}}
function UpdateSelectionState(selectionSetId,toggleElem)
{if(selectionSetId!=null&&toggleElem!=null)
{if(!sessionExpired)
{PageMethods.UpdateExpandState(selectionSetId,expanded);}
else
{HandleSessionExpired();}}}
function RefreshSelectionListContainer()
{try{if(window._SearchListContainer!=undefined){ShowLayer(_SearchListContainer,null,null);}}
catch(e){}}
function HandleMoreSelectionToolsMouseLeave(e)
{var iebody=(document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body
var dsocleft=document.all?iebody.scrollLeft:pageXOffset
var dsoctop=document.all?iebody.scrollTop:pageYOffset
var x=(window.event!=null?window.event.clientX:e.clientX);var y=(window.event!=null?window.event.clientY:e.clientY)+dsoctop;var dim=getElementDimensions(_BoxSelectionTools);var x1=(dim.Left+2),x2=(dim.Left+dim.Width+2),y1=(dim.Top+2),y2=(dim.Top+dim.Height+2);var isMouseWithInElement=(x>x1&&x<x2&&y>y1&&y<y2);if(!isMouseWithInElement)
{HideLayer(_BoxSelectionTools,null,null);}}
function HandleMoreSelectionToolsOut(e){if(isIE)
return;if(e.target.id!=null&&(e.target.id==_BoxSelectionTools+'_mTable'||e.target.id==_BoxSelectionTools)){var node=e.relatedTarget.parentNode;while(node!=null){if(node==e.target){return;}
node=node.parentNode;}
HandleMoreSelectionToolsMouseLeave(e);}}
function DeletedSelectedFeatures()
{jQuery:jConfirm(window.__removeSelectionFeaturesMsg,window._AlertWindowTitle,window._OKText,window._CancelText,function(r)
{if(r)
{if(window.__activeSelectionSetId)
{var selectionSetId=window.__activeSelectionSetId;if(selectionSetId!=null)
{var selectionObject=eval("_selObject_"+selectionSetId);if(selectionObject!=null)
{if(!sessionExpired)
{var currSelected=document.getElementById(selectionObject.SelectedRowsClientID);if(currSelected!=null)
{var selectedItems=currSelected.value;PageMethods.RemoveSelectionItems(selectedItems,RefreshUI);}}
else
{HandleSessionExpired();}}}}}});}
function GetBrowserDimensions()
{var browserWidth=0;var browserHeight=0;if(typeof(window.innerWidth)=='number'){browserWidth=window.innerWidth;browserHeight=window.innerHeight;}else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){browserWidth=document.documentElement.clientWidth;browserHeight=document.documentElement.clientHeight;}else if(document.body&&(document.body.clientWidth||document.body.clientHeight)){browserWidth=document.body.clientWidth;browserHeight=document.body.clientHeight;}
return{width:browserWidth,height:browserHeight};}
function ScrollToSelections()
{try{var marginTop=__scrollToSelectionTopMarginPixel;if(window._SearchListContainer!=undefined){var top=getElementTopPostion(document.getElementById(window._SearchListContainer))+marginTop;var browserDim=GetBrowserDimensions();var scroll=false;var scrollHt=0;if(top>browserDim.height)
{scrollHt=(top-browserDim.height);scroll=true;}
if(scroll)
{window.scrollTo(0,scrollHt);}}}
catch(e){}}
function ScrollToMap()
{window.scrollTo(0,80);}
function ViewSelectionResultsJoins()
{if(window.__activeSelectionSetId)
{var selectionSetId=window.__activeSelectionSetId;if(selectionSetId!=null)
{var selResultsDiv=document.getElementById("selResults");var elemTags=new Array();elemTags[0]="tr";elemTags[1]="div";for(j=0;j<elemTags.length;j++)
{var joinDivs=selResultsDiv.getElementsByTagName(elemTags[j]);var i;for(i=0;i<joinDivs.length;i++)
{var joinDiv=joinDivs[i];if(joinDiv)
{var id=joinDiv.id;if(joinDiv.id.startsWith("selection_results_join_"+selectionSetId))
{if(joinDiv.style.display=="")
{joinDiv.style.display="none";}
else if(joinDiv.style.display=="none")
{joinDiv.style.display="";}}}}}}}
HideLayer(_BoxSelectionTools,null,null);}
function ViewResultsPageJoins()
{var elemTags=new Array();elemTags[0]="tr";elemTags[1]="div";for(j=0;j<elemTags.length;j++)
{var joinDivs=document.getElementsByTagName(elemTags[j]);var i;for(i=0;i<joinDivs.length;i++)
{var joinDiv=joinDivs[i];if(joinDiv)
{var id=joinDiv.id;if(joinDiv.id.startsWith("selection_results_join_"))
{if(joinDiv.style.display=="")
{joinDiv.style.display="none";}
else
{joinDiv.style.display="";}}}}}}
jQuery.ui||(function($){var _remove=$.fn.remove,isFF2=$.browser.mozilla&&(parseFloat($.browser.version)<1.9);$.ui={version:"1.7.2",plugin:{add:function(module,option,set){var proto=$.ui[module].prototype;for(var i in set){proto.plugins[i]=proto.plugins[i]||[];proto.plugins[i].push([option,set[i]]);}},call:function(instance,name,args){var set=instance.plugins[name];if(!set||!instance.element[0].parentNode){return;}
for(var i=0;i<set.length;i++){if(instance.options[set[i][0]]){set[i][1].apply(instance.element,args);}}}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b);},hasScroll:function(el,a){if($(el).css('overflow')=='hidden'){return false;}
var scroll=(a&&a=='left')?'scrollLeft':'scrollTop',has=false;if(el[scroll]>0){return true;}
el[scroll]=1;has=(el[scroll]>0);el[scroll]=0;return has;},isOverAxis:function(x,reference,size){return(x>reference)&&(x<(reference+size));},isOver:function(y,x,top,left,height,width){return $.ui.isOverAxis(y,top,height)&&$.ui.isOverAxis(x,left,width);},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(isFF2){var attr=$.attr,removeAttr=$.fn.removeAttr,ariaNS="http://www.w3.org/2005/07/aaa",ariaState=/^aria-/,ariaRole=/^wairole:/;$.attr=function(elem,name,value){var set=value!==undefined;return(name=='role'?(set?attr.call(this,elem,name,"wairole:"+value):(attr.apply(this,arguments)||"").replace(ariaRole,"")):(ariaState.test(name)?(set?elem.setAttributeNS(ariaNS,name.replace(ariaState,"aaa:"),value):attr.call(this,elem,name.replace(ariaState,"aaa:"))):attr.apply(this,arguments)));};$.fn.removeAttr=function(name){return(ariaState.test(name)?this.each(function(){this.removeAttributeNS(ariaNS,name.replace(ariaState,""));}):removeAttr.call(this,name));};}
$.fn.extend({remove:function(){$("*",this).add(this).each(function(){$(this).triggerHandler("remove");});return _remove.apply(this,arguments);},enableSelection:function(){return this.attr('unselectable','off').css('MozUserSelect','').unbind('selectstart.ui');},disableSelection:function(){return this.attr('unselectable','on').css('MozUserSelect','none').bind('selectstart.ui',function(){return false;});},scrollParent:function(){var scrollParent;if(($.browser.msie&&(/(static|relative)/).test(this.css('position')))||(/absolute/).test(this.css('position'))){scrollParent=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test($.curCSS(this,'position',1))&&(/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));}).eq(0);}else{scrollParent=this.parents().filter(function(){return(/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));}).eq(0);}
return(/fixed/).test(this.css('position'))||!scrollParent.length?$(document):scrollParent;}});$.extend($.expr[':'],{data:function(elem,i,match){return!!$.data(elem,match[3]);},focusable:function(element){var nodeName=element.nodeName.toLowerCase(),tabIndex=$.attr(element,'tabindex');return(/input|select|textarea|button|object/.test(nodeName)?!element.disabled:'a'==nodeName||'area'==nodeName?element.href||!isNaN(tabIndex):!isNaN(tabIndex))&&!$(element)['area'==nodeName?'parents':'closest'](':hidden').length;},tabbable:function(element){var tabIndex=$.attr(element,'tabindex');return(isNaN(tabIndex)||tabIndex>=0)&&$(element).is(':focusable');}});function getter(namespace,plugin,method,args){function getMethods(type){var methods=$[namespace][plugin][type]||[];return(typeof methods=='string'?methods.split(/,?\s+/):methods);}
var methods=getMethods('getter');if(args.length==1&&typeof args[0]=='string'){methods=methods.concat(getMethods('getterSetter'));}
return($.inArray(method,methods)!=-1);}
$.widget=function(name,prototype){var namespace=name.split(".")[0];name=name.split(".")[1];$.fn[name]=function(options){var isMethodCall=(typeof options=='string'),args=Array.prototype.slice.call(arguments,1);if(isMethodCall&&options.substring(0,1)=='_'){return this;}
if(isMethodCall&&getter(namespace,name,options,args)){var instance=$.data(this[0],name);return(instance?instance[options].apply(instance,args):undefined);}
return this.each(function(){var instance=$.data(this,name);(!instance&&!isMethodCall&&$.data(this,name,new $[namespace][name](this,options))._init());(instance&&isMethodCall&&$.isFunction(instance[options])&&instance[options].apply(instance,args));});};$[namespace]=$[namespace]||{};$[namespace][name]=function(element,options){var self=this;this.namespace=namespace;this.widgetName=name;this.widgetEventPrefix=$[namespace][name].eventPrefix||name;this.widgetBaseClass=namespace+'-'+name;this.options=$.extend({},$.widget.defaults,$[namespace][name].defaults,$.metadata&&$.metadata.get(element)[name],options);this.element=$(element).bind('setData.'+name,function(event,key,value){if(event.target==element){return self._setData(key,value);}}).bind('getData.'+name,function(event,key){if(event.target==element){return self._getData(key);}}).bind('remove',function(){return self.destroy();});};$[namespace][name].prototype=$.extend({},$.widget.prototype,prototype);$[namespace][name].getterSetter='option';};$.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+'-disabled'+' '+this.namespace+'-state-disabled').removeAttr('aria-disabled');},option:function(key,value){var options=key,self=this;if(typeof key=="string"){if(value===undefined){return this._getData(key);}
options={};options[key]=value;}
$.each(options,function(key,value){self._setData(key,value);});},_getData:function(key){return this.options[key];},_setData:function(key,value){this.options[key]=value;if(key=='disabled'){this.element
[value?'addClass':'removeClass'](this.widgetBaseClass+'-disabled'+' '+
this.namespace+'-state-disabled').attr("aria-disabled",value);}},enable:function(){this._setData('disabled',false);},disable:function(){this._setData('disabled',true);},_trigger:function(type,event,data){var callback=this.options[type],eventName=(type==this.widgetEventPrefix?type:this.widgetEventPrefix+type);event=$.Event(event);event.type=eventName;if(event.originalEvent){for(var i=$.event.props.length,prop;i;){prop=$.event.props[--i];event[prop]=event.originalEvent[prop];}}
this.element.trigger(event,data);return!($.isFunction(callback)&&callback.call(this.element[0],event,data)===false||event.isDefaultPrevented());}};$.widget.defaults={disabled:false};$.ui.mouse={_mouseInit:function(){var self=this;this.element.bind('mousedown.'+this.widgetName,function(event){return self._mouseDown(event);}).bind('click.'+this.widgetName,function(event){if(self._preventClickEvent){self._preventClickEvent=false;event.stopImmediatePropagation();return false;}});if($.browser.msie){this._mouseUnselectable=this.element.attr('unselectable');this.element.attr('unselectable','on');}
this.started=false;},_mouseDestroy:function(){this.element.unbind('.'+this.widgetName);($.browser.msie&&this.element.attr('unselectable',this._mouseUnselectable));},_mouseDown:function(event){event.originalEvent=event.originalEvent||{};if(event.originalEvent.mouseHandled){return;}
(this._mouseStarted&&this._mouseUp(event));this._mouseDownEvent=event;var self=this,btnIsLeft=(event.which==1),elIsCancel=(typeof this.options.cancel=="string"?$(event.target).parents().add(event.target).filter(this.options.cancel).length:false);if(!btnIsLeft||elIsCancel||!this._mouseCapture(event)){return true;}
this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){self.mouseDelayMet=true;},this.options.delay);}
if(this._mouseDistanceMet(event)&&this._mouseDelayMet(event)){this._mouseStarted=(this._mouseStart(event)!==false);if(!this._mouseStarted){event.preventDefault();return true;}}
this._mouseMoveDelegate=function(event){return self._mouseMove(event);};this._mouseUpDelegate=function(event){return self._mouseUp(event);};$(document).bind('mousemove.'+this.widgetName,this._mouseMoveDelegate).bind('mouseup.'+this.widgetName,this._mouseUpDelegate);($.browser.safari||event.preventDefault());event.originalEvent.mouseHandled=true;return true;},_mouseMove:function(event){if($.browser.msie&&!event.button){return this._mouseUp(event);}
if(this._mouseStarted){this._mouseDrag(event);return event.preventDefault();}
if(this._mouseDistanceMet(event)&&this._mouseDelayMet(event)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,event)!==false);(this._mouseStarted?this._mouseDrag(event):this._mouseUp(event));}
return!this._mouseStarted;},_mouseUp:function(event){$(document).unbind('mousemove.'+this.widgetName,this._mouseMoveDelegate).unbind('mouseup.'+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=(event.target==this._mouseDownEvent.target);this._mouseStop(event);}
return false;},_mouseDistanceMet:function(event){return(Math.max(Math.abs(this._mouseDownEvent.pageX-event.pageX),Math.abs(this._mouseDownEvent.pageY-event.pageY))>=this.options.distance);},_mouseDelayMet:function(event){return this.mouseDelayMet;},_mouseStart:function(event){},_mouseDrag:function(event){},_mouseStop:function(event){},_mouseCapture:function(event){return true;}};$.ui.mouse.defaults={cancel:null,distance:1,delay:0};})(jQuery);function disableOrEnableDiv(radElemId,currentdivElemId,searchDivElemId)
{var radElem=document.getElementById(radElemId);var divElem=document.getElementById(currentdivElemId);var searchdivElem=document.getElementById(searchDivElemId);if(searchdivElem!=null)
{searchdivElem.style.display='none';}
if(radElem!=null&&divElem!=null)
{if(radElem.checked)
{divElem.style.display='block';}}}
function PopupNearbySearchWindow()
{if(window._NearbySearchUrl!=null)
{var url=NGServerUrl()+_NearbySearchUrl+"?NEARBYSEARCHMODE=true&CLEARSELECTIONS=false&DisplayMode=NearbySearch";try
{if(NgGetElementById(_SearchLayer)!=null)
{ShowLayer(_SearchLayer,null,null);var iframeElem=document.getElementById(_SearchIframe);iframeElem.setAttribute('isLoaded','true');var eleWidth=null;var eleHeight=null;if(iframeElem.getAttribute('OriginalWidth')!=null&&typeof iframeElem.getAttribute('OriginalWidth')!='undefined')
eleWidth=iframeElem.getAttribute('OriginalWidth');else if(document.getElementById(_SearchLayer)!=null&&document.getElementById(_SearchLayer).getAttribute('OriginalWidth')!=null)
eleWidth=document.getElementById(_SearchLayer).getAttribute('OriginalWidth');if(iframeElem.getAttribute('OriginalHeight')!=null&&typeof iframeElem.getAttribute('OriginalHeight')!='undefined')
eleHeight=iframeElem.getAttribute('OriginalHeight');else if(document.getElementById(_SearchLayer)!=null&&document.getElementById(_SearchLayer).getAttribute('OriginalHeight')!=null)
eleHeight=document.getElementById(_SearchLayer).getAttribute('OriginalHeight');ResizeIFrame(_SearchIframe,eleWidth,eleHeight);PopulateiFrame(_SearchIframe,url,null,null);}}catch(e){}}
else
{OpenNearbySearchWindow(false);}}
function ShowNearbySearchWindow()
{OpenNearbySearchWindow(true);}
function OpenNearbySearchWindow(clearSelections)
{var path="/Webpages/Search/NearbySearchPopup.aspx?CLEARSELECTIONS="+clearSelections;if(window.NGServerUrl)
{path=NGServerUrl()+path;}
else
{var protocol=window.location.protocol;var theHost=window.location.hostname;var port=window.location.port;if(port)
{port=":"+port;}
var ThePath=window.location.pathname;ThePath=ThePath.substring(0,ThePath.indexOf("/",1));path=protocol+"//"+theHost+port+ThePath+path;}
var searchUrl=path;if(window.HandleNearbySearchFrame)
{HandleNearbySearchFrame(searchUrl);}
else
{window.open(searchUrl,"NearbySearchWindow","toolbar=no, directories=no, location=no,status=yes, menubar=no, resizable=yes, scrollbars=auto, width=550, height=500");}}
function NearbyItemSelected(id,itemId)
{if(window.isSearchResultBtnVisible!=undefined)
{if(isSearchResultBtnVisible)
{PageMethods.SetNearbySelectedItem(itemId,PopupNearbySearchWindow);}
else
{PageMethods.SetNearbySelectedItem(itemId,OpenNearbySearchWindow);}}
else
{PageMethods.SetNearbySelectedItem(itemId,PopupNearbySearchWindow);}}
function drpSearchesList_change(drpElementId,hidElementId)
{if(drpElementId!=null&&hidElementId!=null)
{var hidElement=document.getElementById(hidElementId);var drpElement=document.getElementById(drpElementId);if(hidElement!=null&&drpElement!=null)
{hidElement.value=drpElement.value;}}}
function HideNearbySearchPopupWindow()
{ResultManagerControlExecute(m_mapViewerPage,true);}
function ResultManagerControlExecute(mapViewPage,hide)
{m_mapViewerPage=mapViewPage;try
{var currentPage=window.top.location.href;if(IsSamePage(mapViewPage.toUpperCase(),currentPage.toUpperCase(),".ASPX")){if(hide&&window.top.HideNearbySearchWindow)
{window.top.HideNearbySearchWindow();}
window.top.ShowLoading();window.top.UpdatePanel('Map|SelectionListContainer');window.top.OnRequestEndHandler('HideLoading();');}
else{if(hide&&window.top.HideNearbySearchWindow){window.top.HideNearbySearchWindow();}
window.top.ShowLoading();window.top.UpdatePanel('Map|SelectionListContainer');window.top.OnRequestEndHandler('HideLoading();');}}
catch(e){}}
function HandleNearbySearchFrame(url)
{var nearbysearch=NgGetElementById(_NearbySearchControlLayer);if(nearbysearch!=null)
{ShowLayer(_NearbySearchControlLayer,null,null);nearbysearch.style.visibility='visible';nearbysearch.style.display="block";if(url==null)
{url=NgGetElementById(_NearbySearchURLHolder).value;}
if(url!=null)
{PopulateiFrame(_NearbySearchiFrame,url,null,null);NgGetElementById(_NearbySearchURLHolder).value=url;}}
return;}
function HideNearbySearchWindow()
{if(_NearbySearchiFrame!=null&&_NearbySearchControlLayer!=null)
{var _iFrame;try
{_iFrame=NgGetElementById(_NearbySearchiFrame);}
catch(e){}
if(_NearbySearchControlLayer!=null)
{var _iFrameLayer;try
{_iFrameLayer=NgGetElementById(_NearbySearchControlLayer);}
catch(e){}
if(_iFrameLayer!=null)
{HideLayer(_NearbySearchControlLayer,null,null);_iFrameLayer.style.visibility='hidden';}}
if(_iFrame!=null)
{_iFrame.style.display='none';HideLayer(_NearbySearchiFrame,null,null);window.top.frames[_NearbySearchiFrame].location.href='about:blank';}}}
function IsSamePage(page1,page2,extension)
{var trimmedPage1=_ExtractPage(page1,extension);var trimmedPage2=_ExtractPage(page2,extension);return trimmedPage1==trimmedPage2;}
function _ExtractPage(page,extension)
{var lastFSlash=page.lastIndexOf("/");var lastPageExt=page.indexOf(extension,lastFSlash);var trimmedPage=page.substring(lastFSlash,lastPageExt);return trimmedPage;}
﻿
function Search_clientClick()
{if(!sessionExpired)
{var searchByCoordObj=jsSearchByCoordsObj;if(searchByCoordObj!=null)
{searchByCoordObj.ApplySearch();}}
else
{HandleSessionExpired();}}
function Reset_clientClick()
{if(!sessionExpired)
{var searchByCoordObj=jsSearchByCoordsObj;if(searchByCoordObj!=null)
{searchByCoordObj.ResetAll();}}
else
{HandleSessionExpired();}}
function HideSearchByCoords(divElemId)
{var divElem=document.getElementById(divElemId);if(divElem!=null)
{divElem.style.visibility="hidden";divElem.style.display="none";}}
function DisplaySearchByCoords(divElemId)
{if(!sessionExpired)
{var divElem=document.getElementById(divElemId);if(divElem!=null)
{var searchByCoordObj=jsSearchByCoordsObj;if(searchByCoordObj!=null)
{searchByCoordObj.ResetScale();}
divElem.style.visibility="visible";divElem.style.display="block";xZIndex(divElem,highZ++);}}
else
{HandleSessionExpired();}}
function SearchByCoordsClient(txtXCoordElemId,txtYCoordElemId,txtScaleElemId,drpProjectionElemId)
{var m_scaleElementId=txtScaleElemId;this.XCoordElemId=txtXCoordElemId;this.YCoordElemId=txtYCoordElemId;this.ScaleElemId=txtScaleElemId;this.ProjectionElemId=drpProjectionElemId;this.ApplySearch=processSearchByCoord;this.ResetAll=clearControls;this.ResetScale=ResetMaptabScale;function clearControls()
{if(!sessionExpired)
{var xCoord=document.getElementById(this.XCoordElemId);var yCoord=document.getElementById(this.YCoordElemId);var scale=document.getElementById(this.ScaleElemId);if(xCoord!=null)
{xCoord.value="";}
if(yCoord!=null)
{yCoord.value="";}
if(scale!=null)
{scale.value="";}
var drpElem=document.getElementById(this.ProjectionElemId);if(drpElem!=null&&drpElem!='undefined')
{drpElem.selectedIndex=0;}}
else
{HandleSessionExpired();}}
var status=false;function processSearchByCoord()
{var xCoord=StringUtil.trim(getElementValue(this.XCoordElemId));var yCoord=StringUtil.trim(getElementValue(this.YCoordElemId));var scale=StringUtil.trim(getElementValue(this.ScaleElemId));var projection=null;var flag=true;var drpElem=document.getElementById(this.ProjectionElemId);if(!sessionExpired)
{if(drpElem!=null&&drpElem!='undefined')
{var selectedIndex=drpElem.selectedIndex;if(selectedIndex==-1)
{jQuery:jAlert(select_coordinate_system,window._AlertWindowTitle,window._OKText,'error',function(r)
{});flag=false;}
projection=getOptionValue(this.ProjectionElemId);}
else
{projection=-1;}
if(flag&&xCoord=="")
{if(flag&&yCoord=="")
{jQuery:jAlert(empty_xycoordinate,window._AlertWindowTitle,window._OKText,'error',function(r)
{});flag=false;}
else
{jQuery:jAlert(empty_xcoordinate,window._AlertWindowTitle,window._OKText,'error',function(r)
{});flag=false;}}
if(flag&&xCoord!=""&&yCoord=="")
{jQuery:jAlert(empty_ycoordinate,window._AlertWindowTitle,window._OKText,'error',function(r)
{});flag=false;}
var xValue=parseFloat(xCoord);var yValue=parseFloat(yCoord);var sValue=parseFloat(scale);if(flag&&xValue!=null&&IsNumeric(xCoord)==false)
{if(flag&&yValue!=null&&IsNumeric(yCoord)==false)
{jQuery:jAlert(numeric_xycoordinate,window._AlertWindowTitle,window._OKText,'error',function(r)
{});flag=false;}
else
{jQuery:jAlert(numeric_xcoordinate,window._AlertWindowTitle,window._OKText,'error',function(r)
{});flag=false;}}
if(flag&&xValue!=null&&IsNumeric(xCoord)==true&&yValue!=null&&IsNumeric(yCoord)==false)
{jQuery:jAlert(numeric_ycoordinate,window._AlertWindowTitle,window._OKText,'error',function(r)
{});flag=false;}
if(flag&&scale=="")
{jQuery:jAlert(empty_scale,window._AlertWindowTitle,window._OKText,'error',function(r)
{});flag=false;}
if(flag&&scale!=null&&IsNumeric(scale)==false)
{jQuery:jAlert(numeric_scale,window._AlertWindowTitle,window._OKText,'error',function(r)
{});flag=false;}
if(flag&&xCoord!=null&&yCoord!=null&&scale!=null&&projection!=null)
{var searchByCoordObject=PageMethods;if(searchByCoordObject!=null)
{searchByCoordObject.ProcessSearch(xCoord,yCoord,scale,projection,HandleSearchByCoords);}}}
else
{HandleSessionExpired();}
return status;}
function ResetMaptabScale()
{if(PageMethods!=null)
{PageMethods.GetCurrentMapTabScale(HandleGetCurrentMapTabScale);}}
function HandleGetCurrentMapTabScale(postData)
{var scaleElement=document.getElementById(m_scaleElementId);if(scaleElement!=null)
{scaleElement.value=postData;}}
function HandleSearchByCoords(newEnvelope)
{if(newEnvelope&&newEnvelope.length>0)
{var values=newEnvelope.split(",");if(values!=null&&values.length>3)
{var mapCtrl=g_OLMapCtrls[0];if(mapCtrl!=null)
{var bounds=new OpenLayers.Bounds(parseFloat(values[0]),parseFloat(values[1]),parseFloat(values[2]),parseFloat(values[3]));if(bounds!=null)
{mapCtrl.zoomToExtent(bounds);mapCtrl.SetCross(((bounds.right-bounds.left)/2)+bounds.left,((bounds.top-bounds.bottom)/2)+bounds.bottom);}}}}}
function IsNumeric(strString)
{var strValidChars="0123456789.-,";var strChar;var blnResult=true;if(strString.length==0)return false;for(i=0;i<strString.length&&blnResult==true;i++)
{strChar=strString.charAt(i);if(strValidChars.indexOf(strChar)==-1)
{blnResult=false;}
else
{blnResult=true;}}
return blnResult;}
function getElementValue(elementId)
{var elemValue=null;var elem=document.getElementById(elementId);if(elem!=null)
{elemValue=elem.value;}
return elemValue;}
function getOptionValue(drpElemId)
{var optionValue=null;if(drpElemId!=null)
{var drpElem=document.getElementById(drpElemId);if(drpElem!=null&&drpElem!='undefined')
{var selectedIndex=drpElem.selectedIndex;if(drpElem!=null&&selectedIndex!=null&&selectedIndex!=-1)
{var option=drpElem.options[selectedIndex];if(option!=null)
{optionValue=option.value;}}}}
return optionValue;}}
if(typeof YAHOO=="undefined"||!YAHOO){var YAHOO={};}YAHOO.namespace=function(){var A=arguments,E=null,C,B,D;for(C=0;C<A.length;C=C+1){D=A[C].split(".");E=YAHOO;for(B=(D[0]=="YAHOO")?1:0;B<D.length;B=B+1){E[D[B]]=E[D[B]]||{};E=E[D[B]];}}return E;};YAHOO.log=function(D,A,C){var B=YAHOO.widget.Logger;if(B&&B.log){return B.log(D,A,C);}else{return false;}};YAHOO.register=function(A,E,D){var I=YAHOO.env.modules;if(!I[A]){I[A]={versions:[],builds:[]};}var B=I[A],H=D.version,G=D.build,F=YAHOO.env.listeners;B.name=A;B.version=H;B.build=G;B.versions.push(H);B.builds.push(G);B.mainClass=E;for(var C=0;C<F.length;C=C+1){F[C](B);}if(E){E.VERSION=H;E.BUILD=G;}else{YAHOO.log("mainClass is undefined for module "+A,"warn");}};YAHOO.env=YAHOO.env||{modules:[],listeners:[]};YAHOO.env.getVersion=function(A){return YAHOO.env.modules[A]||null;};YAHOO.env.ua=function(){var C={ie:0,opera:0,gecko:0,webkit:0,mobile:null,air:0};var B=navigator.userAgent,A;if((/KHTML/).test(B)){C.webkit=1;}A=B.match(/AppleWebKit\/([^\s]*)/);if(A&&A[1]){C.webkit=parseFloat(A[1]);if(/ Mobile\//.test(B)){C.mobile="Apple";}else{A=B.match(/NokiaN[^\/]*/);if(A){C.mobile=A[0];}}A=B.match(/AdobeAIR\/([^\s]*)/);if(A){C.air=A[0];}}if(!C.webkit){A=B.match(/Opera[\s\/]([^\s]*)/);if(A&&A[1]){C.opera=parseFloat(A[1]);A=B.match(/Opera Mini[^;]*/);if(A){C.mobile=A[0];}}else{A=B.match(/MSIE\s([^;]*)/);if(A&&A[1]){C.ie=parseFloat(A[1]);}else{A=B.match(/Gecko\/([^\s]*)/);if(A){C.gecko=1;A=B.match(/rv:([^\s\)]*)/);if(A&&A[1]){C.gecko=parseFloat(A[1]);}}}}}return C;}();(function(){YAHOO.namespace("util","widget","example");if("undefined"!==typeof YAHOO_config){var B=YAHOO_config.listener,A=YAHOO.env.listeners,D=true,C;if(B){for(C=0;C<A.length;C=C+1){if(A[C]==B){D=false;break;}}if(D){A.push(B);}}}})();YAHOO.lang=YAHOO.lang||{isArray:function(B){if(B){var A=YAHOO.lang;return A.isNumber(B.length)&&A.isFunction(B.splice);}return false;},isBoolean:function(A){return typeof A==="boolean";},isFunction:function(A){return typeof A==="function";},isNull:function(A){return A===null;},isNumber:function(A){return typeof A==="number"&&isFinite(A);},isObject:function(A){return(A&&(typeof A==="object"||YAHOO.lang.isFunction(A)))||false;},isString:function(A){return typeof A==="string";},isUndefined:function(A){return typeof A==="undefined";},hasOwnProperty:function(A,B){if(Object.prototype.hasOwnProperty){return A.hasOwnProperty(B);}return!YAHOO.lang.isUndefined(A[B])&&A.constructor.prototype[B]!==A[B];},_IEEnumFix:function(C,B){if(YAHOO.env.ua.ie){var E=["toString","valueOf"],A;for(A=0;A<E.length;A=A+1){var F=E[A],D=B[F];if(YAHOO.lang.isFunction(D)&&D!=Object.prototype[F]){C[F]=D;}}}},extend:function(D,E,C){if(!E||!D){throw new Error("YAHOO.lang.extend failed, please check that "+"all dependencies are included.");}var B=function(){};B.prototype=E.prototype;D.prototype=new B();D.prototype.constructor=D;D.superclass=E.prototype;if(E.prototype.constructor==Object.prototype.constructor){E.prototype.constructor=E;}if(C){for(var A in C){D.prototype[A]=C[A];}YAHOO.lang._IEEnumFix(D.prototype,C);}},augmentObject:function(E,D){if(!D||!E){throw new Error("Absorb failed, verify dependencies.");}var A=arguments,C,F,B=A[2];if(B&&B!==true){for(C=2;C<A.length;C=C+1){E[A[C]]=D[A[C]];}}else{for(F in D){if(B||!E[F]){E[F]=D[F];}}YAHOO.lang._IEEnumFix(E,D);}},augmentProto:function(D,C){if(!C||!D){throw new Error("Augment failed, verify dependencies.");}var A=[D.prototype,C.prototype];for(var B=2;B<arguments.length;B=B+1){A.push(arguments[B]);}YAHOO.lang.augmentObject.apply(this,A);},dump:function(A,G){var C=YAHOO.lang,D,F,I=[],J="{...}",B="f(){...}",H=", ",E=" => ";if(!C.isObject(A)){return A+"";}else{if(A instanceof Date||("nodeType"in A&&"tagName"in A)){return A;}else{if(C.isFunction(A)){return B;}}}G=(C.isNumber(G))?G:3;if(C.isArray(A)){I.push("[");for(D=0,F=A.length;D<F;D=D+1){if(C.isObject(A[D])){I.push((G>0)?C.dump(A[D],G-1):J);}else{I.push(A[D]);}I.push(H);}if(I.length>1){I.pop();}I.push("]");}else{I.push("{");for(D in A){if(C.hasOwnProperty(A,D)){I.push(D+E);if(C.isObject(A[D])){I.push((G>0)?C.dump(A[D],G-1):J);}else{I.push(A[D]);}I.push(H);}}if(I.length>1){I.pop();}I.push("}");}return I.join("");},substitute:function(Q,B,J){var G,F,E,M,N,P,D=YAHOO.lang,L=[],C,H="dump",K=" ",A="{",O="}";for(;;){G=Q.lastIndexOf(A);if(G<0){break;}F=Q.indexOf(O,G);if(G+1>=F){break;}C=Q.substring(G+1,F);M=C;P=null;E=M.indexOf(K);if(E>-1){P=M.substring(E+1);M=M.substring(0,E);}N=B[M];if(J){N=J(M,N,P);}if(D.isObject(N)){if(D.isArray(N)){N=D.dump(N,parseInt(P,10));}else{P=P||"";var I=P.indexOf(H);if(I>-1){P=P.substring(4);}if(N.toString===Object.prototype.toString||I>-1){N=D.dump(N,parseInt(P,10));}else{N=N.toString();}}}else{if(!D.isString(N)&&!D.isNumber(N)){N="~-"+L.length+"-~";L[L.length]=C;}}Q=Q.substring(0,G)+N+Q.substring(F+1);}for(G=L.length-1;G>=0;G=G-1){Q=Q.replace(new RegExp("~-"+G+"-~"),"{"+L[G]+"}","g");}return Q;},trim:function(A){try{return A.replace(/^\s+|\s+$/g,"");}catch(B){return A;}},merge:function(){var D={},B=arguments;for(var C=0,A=B.length;C<A;C=C+1){YAHOO.lang.augmentObject(D,B[C],true);}return D;},later:function(H,B,I,D,E){H=H||0;B=B||{};var C=I,G=D,F,A;if(YAHOO.lang.isString(I)){C=B[I];}if(!C){throw new TypeError("method undefined");}if(!YAHOO.lang.isArray(G)){G=[D];}F=function(){C.apply(B,G);};A=(E)?setInterval(F,H):setTimeout(F,H);return{interval:E,cancel:function(){if(this.interval){clearInterval(A);}else{clearTimeout(A);}}};},isValue:function(B){var A=YAHOO.lang;return(A.isObject(B)||A.isString(B)||A.isNumber(B)||A.isBoolean(B));}};YAHOO.util.Lang=YAHOO.lang;YAHOO.lang.augment=YAHOO.lang.augmentProto;YAHOO.augment=YAHOO.lang.augmentProto;YAHOO.extend=YAHOO.lang.extend;YAHOO.register("yahoo",YAHOO,{version:"2.5.1",build:"984"});YAHOO.util.CustomEvent=function(D,B,C,A){this.type=D;this.scope=B||window;this.silent=C;this.signature=A||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}var E="_YUICEOnSubscribe";if(D!==E){this.subscribeEvent=new YAHOO.util.CustomEvent(E,this,true);}this.lastError=null;};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(B,C,A){if(!B){throw new Error("Invalid callback for subscriber to '"+this.type+"'");}if(this.subscribeEvent){this.subscribeEvent.fire(B,C,A);}this.subscribers.push(new YAHOO.util.Subscriber(B,C,A));},unsubscribe:function(D,F){if(!D){return this.unsubscribeAll();}var E=false;for(var B=0,A=this.subscribers.length;B<A;++B){var C=this.subscribers[B];if(C&&C.contains(D,F)){this._delete(B);E=true;}}return E;},fire:function(){var D=this.subscribers.length;if(!D&&this.silent){return true;}var H=[].slice.call(arguments,0),F=true,C,I=false;if(!this.silent){}var B=this.subscribers.slice();for(C=0;C<D;++C){var K=B[C];if(!K){I=true;}else{if(!this.silent){}var J=K.getScope(this.scope);if(this.signature==YAHOO.util.CustomEvent.FLAT){var A=null;if(H.length>0){A=H[0];}try{F=K.fn.call(J,A,K.obj);}catch(E){this.lastError=E;}}else{try{F=K.fn.call(J,this.type,H,K.obj);}catch(G){this.lastError=G;}}if(false===F){if(!this.silent){}return false;}}}return true;},unsubscribeAll:function(){for(var A=this.subscribers.length-1;A>-1;A--){this._delete(A);}this.subscribers=[];return A;},_delete:function(A){var B=this.subscribers[A];if(B){delete B.fn;delete B.obj;}this.subscribers.splice(A,1);},toString:function(){return"CustomEvent: "+"'"+this.type+"', "+"scope: "+this.scope;}};YAHOO.util.Subscriber=function(B,C,A){this.fn=B;this.obj=YAHOO.lang.isUndefined(C)?null:C;this.override=A;};YAHOO.util.Subscriber.prototype.getScope=function(A){if(this.override){if(this.override===true){return this.obj;}else{return this.override;}}return A;};YAHOO.util.Subscriber.prototype.contains=function(A,B){if(B){return(this.fn==A&&this.obj==B);}else{return(this.fn==A);}};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+this.obj+", override: "+(this.override||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var H=false;var I=[];var J=[];var G=[];var E=[];var C=0;var F=[];var B=[];var A=0;var D={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9};return{POLL_RETRYS:2000,POLL_INTERVAL:20,EL:0,TYPE:1,FN:2,WFN:3,UNLOAD_OBJ:3,ADJ_SCOPE:4,OBJ:5,OVERRIDE:6,lastError:null,isSafari:YAHOO.env.ua.webkit,webkit:YAHOO.env.ua.webkit,isIE:YAHOO.env.ua.ie,_interval:null,_dri:null,DOMReady:false,startInterval:function(){if(!this._interval){var K=this;var L=function(){K._tryPreloadAttach();};this._interval=setInterval(L,this.POLL_INTERVAL);}},onAvailable:function(P,M,Q,O,N){var K=(YAHOO.lang.isString(P))?[P]:P;for(var L=0;L<K.length;L=L+1){F.push({id:K[L],fn:M,obj:Q,override:O,checkReady:N});}C=this.POLL_RETRYS;this.startInterval();},onContentReady:function(M,K,N,L){this.onAvailable(M,K,N,L,true);},onDOMReady:function(K,M,L){if(this.DOMReady){setTimeout(function(){var N=window;if(L){if(L===true){N=M;}else{N=L;}}K.call(N,"DOMReady",[],M);},0);}else{this.DOMReadyEvent.subscribe(K,M,L);}},addListener:function(M,K,V,Q,L){if(!V||!V.call){return false;}if(this._isValidCollection(M)){var W=true;for(var R=0,T=M.length;R<T;++R){W=this.on(M[R],K,V,Q,L)&&W;}return W;}else{if(YAHOO.lang.isString(M)){var P=this.getEl(M);if(P){M=P;}else{this.onAvailable(M,function(){YAHOO.util.Event.on(M,K,V,Q,L);});return true;}}}if(!M){return false;}if("unload"==K&&Q!==this){J[J.length]=[M,K,V,Q,L];return true;}var Y=M;if(L){if(L===true){Y=Q;}else{Y=L;}}var N=function(Z){return V.call(Y,YAHOO.util.Event.getEvent(Z,M),Q);};var X=[M,K,V,N,Y,Q,L];var S=I.length;I[S]=X;if(this.useLegacyEvent(M,K)){var O=this.getLegacyIndex(M,K);if(O==-1||M!=G[O][0]){O=G.length;B[M.id+K]=O;G[O]=[M,K,M["on"+K]];E[O]=[];M["on"+K]=function(Z){YAHOO.util.Event.fireLegacyEvent(YAHOO.util.Event.getEvent(Z),O);};}E[O].push(X);}else{try{this._simpleAdd(M,K,N,false);}catch(U){this.lastError=U;this.removeListener(M,K,V);return false;}}return true;},fireLegacyEvent:function(O,M){var Q=true,K,S,R,T,P;S=E[M].slice();for(var L=0,N=S.length;L<N;++L){R=S[L];if(R&&R[this.WFN]){T=R[this.ADJ_SCOPE];P=R[this.WFN].call(T,O);Q=(Q&&P);}}K=G[M];if(K&&K[2]){K[2](O);}return Q;},getLegacyIndex:function(L,M){var K=this.generateId(L)+M;if(typeof B[K]=="undefined"){return-1;}else{return B[K];}},useLegacyEvent:function(L,M){if(this.webkit&&("click"==M||"dblclick"==M)){var K=parseInt(this.webkit,10);if(!isNaN(K)&&K<418){return true;}}return false;},removeListener:function(L,K,T){var O,R,V;if(typeof L=="string"){L=this.getEl(L);}else{if(this._isValidCollection(L)){var U=true;for(O=L.length-1;O>-1;O--){U=(this.removeListener(L[O],K,T)&&U);}return U;}}if(!T||!T.call){return this.purgeElement(L,false,K);}if("unload"==K){for(O=J.length-1;O>-1;O--){V=J[O];if(V&&V[0]==L&&V[1]==K&&V[2]==T){J.splice(O,1);return true;}}return false;}var P=null;var Q=arguments[3];if("undefined"===typeof Q){Q=this._getCacheIndex(L,K,T);}if(Q>=0){P=I[Q];}if(!L||!P){return false;}if(this.useLegacyEvent(L,K)){var N=this.getLegacyIndex(L,K);var M=E[N];if(M){for(O=0,R=M.length;O<R;++O){V=M[O];if(V&&V[this.EL]==L&&V[this.TYPE]==K&&V[this.FN]==T){M.splice(O,1);break;}}}}else{try{this._simpleRemove(L,K,P[this.WFN],false);}catch(S){this.lastError=S;return false;}}delete I[Q][this.WFN];delete I[Q][this.FN];I.splice(Q,1);return true;},getTarget:function(M,L){var K=M.target||M.srcElement;return this.resolveTextNode(K);},resolveTextNode:function(L){try{if(L&&3==L.nodeType){return L.parentNode;}}catch(K){}return L;},getPageX:function(L){var K=L.pageX;if(!K&&0!==K){K=L.clientX||0;if(this.isIE){K+=this._getScrollLeft();}}return K;},getPageY:function(K){var L=K.pageY;if(!L&&0!==L){L=K.clientY||0;if(this.isIE){L+=this._getScrollTop();}}return L;},getXY:function(K){return[this.getPageX(K),this.getPageY(K)];},getRelatedTarget:function(L){var K=L.relatedTarget;if(!K){if(L.type=="mouseout"){K=L.toElement;}else{if(L.type=="mouseover"){K=L.fromElement;}}}return this.resolveTextNode(K);},getTime:function(M){if(!M.time){var L=new Date().getTime();try{M.time=L;}catch(K){this.lastError=K;return L;}}return M.time;},stopEvent:function(K){this.stopPropagation(K);this.preventDefault(K);},stopPropagation:function(K){if(K.stopPropagation){K.stopPropagation();}else{K.cancelBubble=true;}},preventDefault:function(K){if(K.preventDefault){K.preventDefault();}else{K.returnValue=false;}},getEvent:function(M,K){var L=M||window.event;if(!L){var N=this.getEvent.caller;while(N){L=N.arguments[0];if(L&&Event==L.constructor){break;}N=N.caller;}}return L;},getCharCode:function(L){var K=L.keyCode||L.charCode||0;if(YAHOO.env.ua.webkit&&(K in D)){K=D[K];}return K;},_getCacheIndex:function(O,P,N){for(var M=0,L=I.length;M<L;M=M+1){var K=I[M];if(K&&K[this.FN]==N&&K[this.EL]==O&&K[this.TYPE]==P){return M;}}return-1;},generateId:function(K){var L=K.id;if(!L){L="yuievtautoid-"+A;++A;K.id=L;}return L;},_isValidCollection:function(L){try{return(L&&typeof L!=="string"&&L.length&&!L.tagName&&!L.alert&&typeof L[0]!=="undefined");}catch(K){return false;}},elCache:{},getEl:function(K){return(typeof K==="string")?document.getElementById(K):K;},clearCache:function(){},DOMReadyEvent:new YAHOO.util.CustomEvent("DOMReady",this),_load:function(L){if(!H){H=true;var K=YAHOO.util.Event;K._ready();K._tryPreloadAttach();}},_ready:function(L){var K=YAHOO.util.Event;if(!K.DOMReady){K.DOMReady=true;K.DOMReadyEvent.fire();K._simpleRemove(document,"DOMContentLoaded",K._ready);}},_tryPreloadAttach:function(){if(F.length===0){C=0;clearInterval(this._interval);this._interval=null;return;}if(this.locked){return;}if(this.isIE){if(!this.DOMReady){this.startInterval();return;}}this.locked=true;var Q=!H;if(!Q){Q=(C>0&&F.length>0);}var P=[];var R=function(T,U){var S=T;if(U.override){if(U.override===true){S=U.obj;}else{S=U.override;}}U.fn.call(S,U.obj);};var L,K,O,N,M=[];for(L=0,K=F.length;L<K;L=L+1){O=F[L];if(O){N=this.getEl(O.id);if(N){if(O.checkReady){if(H||N.nextSibling||!Q){M.push(O);F[L]=null;}}else{R(N,O);F[L]=null;}}else{P.push(O);}}}for(L=0,K=M.length;L<K;L=L+1){O=M[L];R(this.getEl(O.id),O);}C--;if(Q){for(L=F.length-1;L>-1;L--){O=F[L];if(!O||!O.id){F.splice(L,1);}}this.startInterval();}else{clearInterval(this._interval);this._interval=null;}this.locked=false;},purgeElement:function(O,P,R){var M=(YAHOO.lang.isString(O))?this.getEl(O):O;var Q=this.getListeners(M,R),N,K;if(Q){for(N=Q.length-1;N>-1;N--){var L=Q[N];this.removeListener(M,L.type,L.fn);}}if(P&&M&&M.childNodes){for(N=0,K=M.childNodes.length;N<K;++N){this.purgeElement(M.childNodes[N],P,R);}}},getListeners:function(M,K){var P=[],L;if(!K){L=[I,J];}else{if(K==="unload"){L=[J];}else{L=[I];}}var R=(YAHOO.lang.isString(M))?this.getEl(M):M;for(var O=0;O<L.length;O=O+1){var T=L[O];if(T){for(var Q=0,S=T.length;Q<S;++Q){var N=T[Q];if(N&&N[this.EL]===R&&(!K||K===N[this.TYPE])){P.push({type:N[this.TYPE],fn:N[this.FN],obj:N[this.OBJ],adjust:N[this.OVERRIDE],scope:N[this.ADJ_SCOPE],index:Q});}}}}return(P.length)?P:null;},_unload:function(Q){var K=YAHOO.util.Event,N,M,L,P,O,R=J.slice();for(N=0,P=J.length;N<P;++N){L=R[N];if(L){var S=window;if(L[K.ADJ_SCOPE]){if(L[K.ADJ_SCOPE]===true){S=L[K.UNLOAD_OBJ];}else{S=L[K.ADJ_SCOPE];}}L[K.FN].call(S,K.getEvent(Q,L[K.EL]),L[K.UNLOAD_OBJ]);R[N]=null;L=null;S=null;}}J=null;if(I){for(M=I.length-1;M>-1;M--){L=I[M];if(L){K.removeListener(L[K.EL],L[K.TYPE],L[K.FN],M);}}L=null;}G=null;K._simpleRemove(window,"unload",K._unload);},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var K=document.documentElement,L=document.body;if(K&&(K.scrollTop||K.scrollLeft)){return[K.scrollTop,K.scrollLeft];}else{if(L){return[L.scrollTop,L.scrollLeft];}else{return[0,0];}}},regCE:function(){},_simpleAdd:function(){if(window.addEventListener){return function(M,N,L,K){M.addEventListener(N,L,(K));};}else{if(window.attachEvent){return function(M,N,L,K){M.attachEvent("on"+N,L);};}else{return function(){};}}}(),_simpleRemove:function(){if(window.removeEventListener){return function(M,N,L,K){M.removeEventListener(N,L,(K));};}else{if(window.detachEvent){return function(L,M,K){L.detachEvent("on"+M,K);};}else{return function(){};}}}()};}();(function(){var EU=YAHOO.util.Event;EU.on=EU.addListener;if(EU.isIE){YAHOO.util.Event.onDOMReady(YAHOO.util.Event._tryPreloadAttach,YAHOO.util.Event,true);var n=document.createElement("p");EU._dri=setInterval(function(){try{n.doScroll("left");clearInterval(EU._dri);EU._dri=null;EU._ready();n=null;}catch(ex){}},EU.POLL_INTERVAL);}else{if(EU.webkit&&EU.webkit<525){EU._dri=setInterval(function(){var rs=document.readyState;if("loaded"==rs||"complete"==rs){clearInterval(EU._dri);EU._dri=null;EU._ready();}},EU.POLL_INTERVAL);}else{EU._simpleAdd(document,"DOMContentLoaded",EU._ready);}}EU._simpleAdd(window,"load",EU._load);EU._simpleAdd(window,"unload",EU._unload);EU._tryPreloadAttach();})();}YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(A,C,F,E){this.__yui_events=this.__yui_events||{};var D=this.__yui_events[A];if(D){D.subscribe(C,F,E);}else{this.__yui_subscribers=this.__yui_subscribers||{};var B=this.__yui_subscribers;if(!B[A]){B[A]=[];}B[A].push({fn:C,obj:F,override:E});}},unsubscribe:function(C,E,G){this.__yui_events=this.__yui_events||{};var A=this.__yui_events;if(C){var F=A[C];if(F){return F.unsubscribe(E,G);}}else{var B=true;for(var D in A){if(YAHOO.lang.hasOwnProperty(A,D)){B=B&&A[D].unsubscribe(E,G);}}return B;}return false;},unsubscribeAll:function(A){return this.unsubscribe(A);},createEvent:function(G,D){this.__yui_events=this.__yui_events||{};var A=D||{};var I=this.__yui_events;if(I[G]){}else{var H=A.scope||this;var E=(A.silent);var B=new YAHOO.util.CustomEvent(G,H,E,YAHOO.util.CustomEvent.FLAT);I[G]=B;if(A.onSubscribeCallback){B.subscribeEvent.subscribe(A.onSubscribeCallback);}this.__yui_subscribers=this.__yui_subscribers||{};var F=this.__yui_subscribers[G];if(F){for(var C=0;C<F.length;++C){B.subscribe(F[C].fn,F[C].obj,F[C].override);}}}return I[G];},fireEvent:function(E,D,A,C){this.__yui_events=this.__yui_events||{};var G=this.__yui_events[E];if(!G){return null;}var B=[];for(var F=1;F<arguments.length;++F){B.push(arguments[F]);}return G.fire.apply(G,B);},hasEvent:function(A){if(this.__yui_events){if(this.__yui_events[A]){return true;}}return false;}};YAHOO.util.KeyListener=function(A,F,B,C){if(!A){}else{if(!F){}else{if(!B){}}}if(!C){C=YAHOO.util.KeyListener.KEYDOWN;}var D=new YAHOO.util.CustomEvent("keyPressed");this.enabledEvent=new YAHOO.util.CustomEvent("enabled");this.disabledEvent=new YAHOO.util.CustomEvent("disabled");if(typeof A=="string"){A=document.getElementById(A);}if(typeof B=="function"){D.subscribe(B);}else{D.subscribe(B.fn,B.scope,B.correctScope);}function E(J,I){if(!F.shift){F.shift=false;}if(!F.alt){F.alt=false;}if(!F.ctrl){F.ctrl=false;}if(J.shiftKey==F.shift&&J.altKey==F.alt&&J.ctrlKey==F.ctrl){var G;if(F.keys instanceof Array){for(var H=0;H<F.keys.length;H++){G=F.keys[H];if(G==J.charCode){D.fire(J.charCode,J);break;}else{if(G==J.keyCode){D.fire(J.keyCode,J);break;}}}}else{G=F.keys;if(G==J.charCode){D.fire(J.charCode,J);}else{if(G==J.keyCode){D.fire(J.keyCode,J);}}}}}this.enable=function(){if(!this.enabled){YAHOO.util.Event.addListener(A,C,E);this.enabledEvent.fire(F);}this.enabled=true;};this.disable=function(){if(this.enabled){YAHOO.util.Event.removeListener(A,C,E);this.disabledEvent.fire(F);}this.enabled=false;};this.toString=function(){return"KeyListener ["+F.keys+"] "+A.tagName+(A.id?"["+A.id+"]":"");};};YAHOO.util.KeyListener.KEYDOWN="keydown";YAHOO.util.KeyListener.KEYUP="keyup";YAHOO.util.KeyListener.KEY={ALT:18,BACK_SPACE:8,CAPS_LOCK:20,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,META:224,NUM_LOCK:144,PAGE_DOWN:34,PAGE_UP:33,PAUSE:19,PRINTSCREEN:44,RIGHT:39,SCROLL_LOCK:145,SHIFT:16,SPACE:32,TAB:9,UP:38};YAHOO.register("event",YAHOO.util.Event,{version:"2.5.1",build:"984"});YAHOO.util.Connect={_msxml_progid:["Microsoft.XMLHTTP","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP"],_http_headers:{},_has_http_headers:false,_use_default_post_header:true,_default_post_header:"application/x-www-form-urlencoded; charset=UTF-8",_default_form_header:"application/x-www-form-urlencoded",_use_default_xhr_header:true,_default_xhr_header:"XMLHttpRequest",_has_default_headers:true,_default_headers:{},_isFormSubmit:false,_isFileUpload:false,_formNode:null,_sFormData:null,_poll:{},_timeOut:{},_polling_interval:50,_transaction_id:0,_submitElementValue:null,_hasSubmitListener:(function(){if(YAHOO.util.Event){YAHOO.util.Event.addListener(document,"click",function(B){var A=YAHOO.util.Event.getTarget(B);if(A.nodeName.toLowerCase()=="input"&&(A.type&&A.type.toLowerCase()=="submit")){YAHOO.util.Connect._submitElementValue=encodeURIComponent(A.name)+"="+encodeURIComponent(A.value);}});return true;}return false;})(),startEvent:new YAHOO.util.CustomEvent("start"),completeEvent:new YAHOO.util.CustomEvent("complete"),successEvent:new YAHOO.util.CustomEvent("success"),failureEvent:new YAHOO.util.CustomEvent("failure"),uploadEvent:new YAHOO.util.CustomEvent("upload"),abortEvent:new YAHOO.util.CustomEvent("abort"),_customEvents:{onStart:["startEvent","start"],onComplete:["completeEvent","complete"],onSuccess:["successEvent","success"],onFailure:["failureEvent","failure"],onUpload:["uploadEvent","upload"],onAbort:["abortEvent","abort"]},setProgId:function(A){this._msxml_progid.unshift(A);},setDefaultPostHeader:function(A){if(typeof A=="string"){this._default_post_header=A;}else{if(typeof A=="boolean"){this._use_default_post_header=A;}}},setDefaultXhrHeader:function(A){if(typeof A=="string"){this._default_xhr_header=A;}else{this._use_default_xhr_header=A;}},setPollingInterval:function(A){if(typeof A=="number"&&isFinite(A)){this._polling_interval=A;}},createXhrObject:function(E){var D,A;try{A=new XMLHttpRequest();D={conn:A,tId:E};}catch(C){for(var B=0;B<this._msxml_progid.length;++B){try{A=new ActiveXObject(this._msxml_progid[B]);D={conn:A,tId:E};break;}catch(C){}}}finally{return D;}},getConnectionObject:function(A){var C;var D=this._transaction_id;try{if(!A){C=this.createXhrObject(D);}else{C={};C.tId=D;C.isUpload=true;}if(C){this._transaction_id++;}}catch(B){}finally{return C;}},asyncRequest:function(F,C,E,A){var D=(this._isFileUpload)?this.getConnectionObject(true):this.getConnectionObject();var B=(E&&E.argument)?E.argument:null;if(!D){return null;}else{if(E&&E.customevents){this.initCustomEvents(D,E);}if(this._isFormSubmit){if(this._isFileUpload){this.uploadFile(D,E,C,A);return D;}if(F.toUpperCase()=="GET"){if(this._sFormData.length!==0){C+=((C.indexOf("?")==-1)?"?":"&")+this._sFormData;}}else{if(F.toUpperCase()=="POST"){A=A?this._sFormData+"&"+A:this._sFormData;}}}if(F.toUpperCase()=="GET"&&(E&&E.cache===false)){C+=((C.indexOf("?")==-1)?"?":"&")+"rnd="+new Date().valueOf().toString();}D.conn.open(F,C,true);if(this._use_default_xhr_header){if(!this._default_headers["X-Requested-With"]){this.initHeader("X-Requested-With",this._default_xhr_header,true);}}if((F.toUpperCase()=="POST"&&this._use_default_post_header)&&this._isFormSubmit===false){this.initHeader("Content-Type",this._default_post_header);}if(this._has_default_headers||this._has_http_headers){this.setHeader(D);}this.handleReadyState(D,E);D.conn.send(A||"");if(this._isFormSubmit===true){this.resetFormState();}this.startEvent.fire(D,B);if(D.startEvent){D.startEvent.fire(D,B);}return D;}},initCustomEvents:function(A,C){for(var B in C.customevents){if(this._customEvents[B][0]){A[this._customEvents[B][0]]=new YAHOO.util.CustomEvent(this._customEvents[B][1],(C.scope)?C.scope:null);A[this._customEvents[B][0]].subscribe(C.customevents[B]);}}},handleReadyState:function(C,D){var B=this;var A=(D&&D.argument)?D.argument:null;if(D&&D.timeout){this._timeOut[C.tId]=window.setTimeout(function(){B.abort(C,D,true);},D.timeout);}this._poll[C.tId]=window.setInterval(function(){if(C.conn&&C.conn.readyState===4){window.clearInterval(B._poll[C.tId]);delete B._poll[C.tId];if(D&&D.timeout){window.clearTimeout(B._timeOut[C.tId]);delete B._timeOut[C.tId];}B.completeEvent.fire(C,A);if(C.completeEvent){C.completeEvent.fire(C,A);}B.handleTransactionResponse(C,D);}},this._polling_interval);},handleTransactionResponse:function(F,G,A){var D,C;var B=(G&&G.argument)?G.argument:null;try{if(F.conn.status!==undefined&&F.conn.status!==0){D=F.conn.status;}else{D=13030;}}catch(E){D=13030;}if(D>=200&&D<300||D===1223){C=this.createResponseObject(F,B);if(G&&G.success){if(!G.scope){G.success(C);}else{G.success.apply(G.scope,[C]);}}this.successEvent.fire(C);if(F.successEvent){F.successEvent.fire(C);}}else{switch(D){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:C=this.createExceptionObject(F.tId,B,(A?A:false));if(G&&G.failure){if(!G.scope){G.failure(C);}else{G.failure.apply(G.scope,[C]);}}break;default:C=this.createResponseObject(F,B);if(G&&G.failure){if(!G.scope){G.failure(C);}else{G.failure.apply(G.scope,[C]);}}}this.failureEvent.fire(C);if(F.failureEvent){F.failureEvent.fire(C);}}this.releaseObject(F);C=null;},createResponseObject:function(A,G){var D={};var I={};try{var C=A.conn.getAllResponseHeaders();var F=C.split("\n");for(var E=0;E<F.length;E++){var B=F[E].indexOf(":");if(B!=-1){I[F[E].substring(0,B)]=F[E].substring(B+2);}}}catch(H){}D.tId=A.tId;D.status=(A.conn.status==1223)?204:A.conn.status;D.statusText=(A.conn.status==1223)?"No Content":A.conn.statusText;D.getResponseHeader=I;D.getAllResponseHeaders=C;D.responseText=A.conn.responseText;D.responseXML=A.conn.responseXML;if(G){D.argument=G;}return D;},createExceptionObject:function(H,D,A){var F=0;var G="communication failure";var C=-1;var B="transaction aborted";var E={};E.tId=H;if(A){E.status=C;E.statusText=B;}else{E.status=F;E.statusText=G;}if(D){E.argument=D;}return E;},initHeader:function(A,D,C){var B=(C)?this._default_headers:this._http_headers;B[A]=D;if(C){this._has_default_headers=true;}else{this._has_http_headers=true;}},setHeader:function(A){if(this._has_default_headers){for(var B in this._default_headers){if(YAHOO.lang.hasOwnProperty(this._default_headers,B)){A.conn.setRequestHeader(B,this._default_headers[B]);}}}if(this._has_http_headers){for(var B in this._http_headers){if(YAHOO.lang.hasOwnProperty(this._http_headers,B)){A.conn.setRequestHeader(B,this._http_headers[B]);}}delete this._http_headers;this._http_headers={};this._has_http_headers=false;}},resetDefaultHeaders:function(){delete this._default_headers;this._default_headers={};this._has_default_headers=false;},setForm:function(K,E,B){this.resetFormState();var J;if(typeof K=="string"){J=(document.getElementById(K)||document.forms[K]);}else{if(typeof K=="object"){J=K;}else{return;}}if(E){var F=this.createFrame((window.location.href.toLowerCase().indexOf("https")===0||B)?true:false);this._isFormSubmit=true;this._isFileUpload=true;this._formNode=J;return;}var A,I,G,L;var H=false;for(var D=0;D<J.elements.length;D++){A=J.elements[D];L=A.disabled;I=A.name;G=A.value;if(!L&&I){switch(A.type){case"select-one":case"select-multiple":for(var C=0;C<A.options.length;C++){if(A.options[C].selected){if(window.ActiveXObject){this._sFormData+=encodeURIComponent(I)+"="+encodeURIComponent(A.options[C].attributes["value"].specified?A.options[C].value:A.options[C].text)+"&";}else{this._sFormData+=encodeURIComponent(I)+"="+encodeURIComponent(A.options[C].hasAttribute("value")?A.options[C].value:A.options[C].text)+"&";}}}break;case"radio":case"checkbox":if(A.checked){this._sFormData+=encodeURIComponent(I)+"="+encodeURIComponent(G)+"&";}break;case"file":case undefined:case"reset":case"button":break;case"submit":if(H===false){if(this._hasSubmitListener&&this._submitElementValue){this._sFormData+=this._submitElementValue+"&";}else{this._sFormData+=encodeURIComponent(I)+"="+encodeURIComponent(G)+"&";}H=true;}break;default:this._sFormData+=encodeURIComponent(I)+"="+encodeURIComponent(G)+"&";}}}this._isFormSubmit=true;this._sFormData=this._sFormData.substr(0,this._sFormData.length-1);this.initHeader("Content-Type",this._default_form_header);return this._sFormData;},resetFormState:function(){this._isFormSubmit=false;this._isFileUpload=false;this._formNode=null;this._sFormData="";},createFrame:function(A){var B="yuiIO"+this._transaction_id;var C;if(window.ActiveXObject){C=document.createElement("<iframe id=\""+B+"\" name=\""+B+"\" />");if(typeof A=="boolean"){C.src="javascript:false";}}else{C=document.createElement("iframe");C.id=B;C.name=B;}C.style.position="absolute";C.style.top="-1000px";C.style.left="-1000px";document.body.appendChild(C);},appendPostData:function(A){var D=[];var B=A.split("&");for(var C=0;C<B.length;C++){var E=B[C].indexOf("=");if(E!=-1){D[C]=document.createElement("input");D[C].type="hidden";D[C].name=B[C].substring(0,E);D[C].value=B[C].substring(E+1);this._formNode.appendChild(D[C]);}}return D;},uploadFile:function(D,M,E,C){var N=this;var H="yuiIO"+D.tId;var I="multipart/form-data";var K=document.getElementById(H);var J=(M&&M.argument)?M.argument:null;var B={action:this._formNode.getAttribute("action"),method:this._formNode.getAttribute("method"),target:this._formNode.getAttribute("target")};this._formNode.setAttribute("action",E);this._formNode.setAttribute("method","POST");this._formNode.setAttribute("target",H);if(this._formNode.encoding){this._formNode.setAttribute("encoding",I);}else{this._formNode.setAttribute("enctype",I);}if(C){var L=this.appendPostData(C);}this._formNode.submit();this.startEvent.fire(D,J);if(D.startEvent){D.startEvent.fire(D,J);}if(M&&M.timeout){this._timeOut[D.tId]=window.setTimeout(function(){N.abort(D,M,true);},M.timeout);}if(L&&L.length>0){for(var G=0;G<L.length;G++){this._formNode.removeChild(L[G]);}}for(var A in B){if(YAHOO.lang.hasOwnProperty(B,A)){if(B[A]){this._formNode.setAttribute(A,B[A]);}else{this._formNode.removeAttribute(A);}}}this.resetFormState();var F=function(){if(M&&M.timeout){window.clearTimeout(N._timeOut[D.tId]);delete N._timeOut[D.tId];}N.completeEvent.fire(D,J);if(D.completeEvent){D.completeEvent.fire(D,J);}var P={};P.tId=D.tId;P.argument=M.argument;try{P.responseText=K.contentWindow.document.body?K.contentWindow.document.body.innerHTML:K.contentWindow.document.documentElement.textContent;P.responseXML=K.contentWindow.document.XMLDocument?K.contentWindow.document.XMLDocument:K.contentWindow.document;}catch(O){}if(M&&M.upload){if(!M.scope){M.upload(P);}else{M.upload.apply(M.scope,[P]);}}N.uploadEvent.fire(P);if(D.uploadEvent){D.uploadEvent.fire(P);}YAHOO.util.Event.removeListener(K,"load",F);setTimeout(function(){document.body.removeChild(K);N.releaseObject(D);},100);};YAHOO.util.Event.addListener(K,"load",F);},abort:function(E,G,A){var D;var B=(G&&G.argument)?G.argument:null;if(E&&E.conn){if(this.isCallInProgress(E)){E.conn.abort();window.clearInterval(this._poll[E.tId]);delete this._poll[E.tId];if(A){window.clearTimeout(this._timeOut[E.tId]);delete this._timeOut[E.tId];}D=true;}}else{if(E&&E.isUpload===true){var C="yuiIO"+E.tId;var F=document.getElementById(C);if(F){YAHOO.util.Event.removeListener(F,"load");document.body.removeChild(F);if(A){window.clearTimeout(this._timeOut[E.tId]);delete this._timeOut[E.tId];}D=true;}}else{D=false;}}if(D===true){this.abortEvent.fire(E,B);if(E.abortEvent){E.abortEvent.fire(E,B);}this.handleTransactionResponse(E,G,true);}return D;},isCallInProgress:function(B){if(B&&B.conn){return B.conn.readyState!==4&&B.conn.readyState!==0;}else{if(B&&B.isUpload===true){var A="yuiIO"+B.tId;return document.getElementById(A)?true:false;}else{return false;}}},releaseObject:function(A){if(A&&A.conn){A.conn=null;A=null;}}};YAHOO.register("connection",YAHOO.util.Connect,{version:"2.5.1",build:"984"});(function(){var B=YAHOO.util,K,I,J={},F={},M=window.document;YAHOO.env._id_counter=YAHOO.env._id_counter||0;var C=YAHOO.env.ua.opera,L=YAHOO.env.ua.webkit,A=YAHOO.env.ua.gecko,G=YAHOO.env.ua.ie;var E={HYPHEN:/(-[a-z])/i,ROOT_TAG:/^body|html$/i,OP_SCROLL:/^(?:inline|table-row)$/i};var N=function(P){if(!E.HYPHEN.test(P)){return P;}if(J[P]){return J[P];}var Q=P;while(E.HYPHEN.exec(Q)){Q=Q.replace(RegExp.$1,RegExp.$1.substr(1).toUpperCase());}J[P]=Q;return Q;};var O=function(Q){var P=F[Q];if(!P){P=new RegExp("(?:^|\\s+)"+Q+"(?:\\s+|$)");F[Q]=P;}return P;};if(M.defaultView&&M.defaultView.getComputedStyle){K=function(P,S){var R=null;if(S=="float"){S="cssFloat";}var Q=P.ownerDocument.defaultView.getComputedStyle(P,"");if(Q){R=Q[N(S)];}return P.style[S]||R;};}else{if(M.documentElement.currentStyle&&G){K=function(P,R){switch(N(R)){case"opacity":var T=100;try{T=P.filters["DXImageTransform.Microsoft.Alpha"].opacity;}catch(S){try{T=P.filters("alpha").opacity;}catch(S){}}return T/100;case"float":R="styleFloat";default:var Q=P.currentStyle?P.currentStyle[R]:null;return(P.style[R]||Q);}};}else{K=function(P,Q){return P.style[Q];};}}if(G){I=function(P,Q,R){switch(Q){case"opacity":if(YAHOO.lang.isString(P.style.filter)){P.style.filter="alpha(opacity="+R*100+")";if(!P.currentStyle||!P.currentStyle.hasLayout){P.style.zoom=1;}}break;case"float":Q="styleFloat";default:P.style[Q]=R;}};}else{I=function(P,Q,R){if(Q=="float"){Q="cssFloat";}P.style[Q]=R;};}var D=function(P,Q){return P&&P.nodeType==1&&(!Q||Q(P));};YAHOO.util.Dom={get:function(R){if(R&&(R.nodeType||R.item)){return R;}if(YAHOO.lang.isString(R)||!R){return M.getElementById(R);}if(R.length!==undefined){var S=[];for(var Q=0,P=R.length;Q<P;++Q){S[S.length]=B.Dom.get(R[Q]);}return S;}return R;},getStyle:function(P,R){R=N(R);var Q=function(S){return K(S,R);};return B.Dom.batch(P,Q,B.Dom,true);},setStyle:function(P,R,S){R=N(R);var Q=function(T){I(T,R,S);};B.Dom.batch(P,Q,B.Dom,true);},getXY:function(P){var Q=function(R){if((R.parentNode===null||R.offsetParent===null||this.getStyle(R,"display")=="none")&&R!=R.ownerDocument.body){return false;}return H(R);};return B.Dom.batch(P,Q,B.Dom,true);},getX:function(P){var Q=function(R){return B.Dom.getXY(R)[0];};return B.Dom.batch(P,Q,B.Dom,true);},getY:function(P){var Q=function(R){return B.Dom.getXY(R)[1];};return B.Dom.batch(P,Q,B.Dom,true);},setXY:function(P,S,R){var Q=function(V){var U=this.getStyle(V,"position");if(U=="static"){this.setStyle(V,"position","relative");U="relative";}var X=this.getXY(V);if(X===false){return false;}var W=[parseInt(this.getStyle(V,"left"),10),parseInt(this.getStyle(V,"top"),10)];if(isNaN(W[0])){W[0]=(U=="relative")?0:V.offsetLeft;}if(isNaN(W[1])){W[1]=(U=="relative")?0:V.offsetTop;}if(S[0]!==null){V.style.left=S[0]-X[0]+W[0]+"px";}if(S[1]!==null){V.style.top=S[1]-X[1]+W[1]+"px";}if(!R){var T=this.getXY(V);if((S[0]!==null&&T[0]!=S[0])||(S[1]!==null&&T[1]!=S[1])){this.setXY(V,S,true);}}};B.Dom.batch(P,Q,B.Dom,true);},setX:function(Q,P){B.Dom.setXY(Q,[P,null]);},setY:function(P,Q){B.Dom.setXY(P,[null,Q]);},getRegion:function(P){var Q=function(R){if((R.parentNode===null||R.offsetParent===null||this.getStyle(R,"display")=="none")&&R!=R.ownerDocument.body){return false;}var S=B.Region.getRegion(R);return S;};return B.Dom.batch(P,Q,B.Dom,true);},getClientWidth:function(){return B.Dom.getViewportWidth();},getClientHeight:function(){return B.Dom.getViewportHeight();},getElementsByClassName:function(T,X,U,V){X=X||"*";U=(U)?B.Dom.get(U):null||M;if(!U){return[];}var Q=[],P=U.getElementsByTagName(X),W=O(T);for(var R=0,S=P.length;R<S;++R){if(W.test(P[R].className)){Q[Q.length]=P[R];if(V){V.call(P[R],P[R]);}}}return Q;},hasClass:function(R,Q){var P=O(Q);var S=function(T){return P.test(T.className);};return B.Dom.batch(R,S,B.Dom,true);},addClass:function(Q,P){var R=function(S){if(this.hasClass(S,P)){return false;}S.className=YAHOO.lang.trim([S.className,P].join(" "));return true;};return B.Dom.batch(Q,R,B.Dom,true);},removeClass:function(R,Q){var P=O(Q);var S=function(T){if(!Q||!this.hasClass(T,Q)){return false;}var U=T.className;T.className=U.replace(P," ");if(this.hasClass(T,Q)){this.removeClass(T,Q);}T.className=YAHOO.lang.trim(T.className);return true;};return B.Dom.batch(R,S,B.Dom,true);},replaceClass:function(S,Q,P){if(!P||Q===P){return false;}var R=O(Q);var T=function(U){if(!this.hasClass(U,Q)){this.addClass(U,P);return true;}U.className=U.className.replace(R," "+P+" ");if(this.hasClass(U,Q)){this.replaceClass(U,Q,P);}U.className=YAHOO.lang.trim(U.className);return true;};return B.Dom.batch(S,T,B.Dom,true);},generateId:function(P,R){R=R||"yui-gen";var Q=function(S){if(S&&S.id){return S.id;}var T=R+YAHOO.env._id_counter++;if(S){S.id=T;}return T;};return B.Dom.batch(P,Q,B.Dom,true)||Q.apply(B.Dom,arguments);},isAncestor:function(P,Q){P=B.Dom.get(P);Q=B.Dom.get(Q);if(!P||!Q){return false;}if(P.contains&&Q.nodeType&&!L){return P.contains(Q);}else{if(P.compareDocumentPosition&&Q.nodeType){return!!(P.compareDocumentPosition(Q)&16);}else{if(Q.nodeType){return!!this.getAncestorBy(Q,function(R){return R==P;});}}}return false;},inDocument:function(P){return this.isAncestor(M.documentElement,P);},getElementsBy:function(W,Q,R,T){Q=Q||"*";R=(R)?B.Dom.get(R):null||M;if(!R){return[];}var S=[],V=R.getElementsByTagName(Q);for(var U=0,P=V.length;U<P;++U){if(W(V[U])){S[S.length]=V[U];if(T){T(V[U]);}}}return S;},batch:function(T,W,V,R){T=(T&&(T.tagName||T.item))?T:B.Dom.get(T);if(!T||!W){return false;}var S=(R)?V:window;if(T.tagName||T.length===undefined){return W.call(S,T,V);}var U=[];for(var Q=0,P=T.length;Q<P;++Q){U[U.length]=W.call(S,T[Q],V);}return U;},getDocumentHeight:function(){var Q=(M.compatMode!="CSS1Compat")?M.body.scrollHeight:M.documentElement.scrollHeight;var P=Math.max(Q,B.Dom.getViewportHeight());return P;},getDocumentWidth:function(){var Q=(M.compatMode!="CSS1Compat")?M.body.scrollWidth:M.documentElement.scrollWidth;var P=Math.max(Q,B.Dom.getViewportWidth());return P;},getViewportHeight:function(){var P=self.innerHeight;var Q=M.compatMode;if((Q||G)&&!C){P=(Q=="CSS1Compat")?M.documentElement.clientHeight:M.body.clientHeight;}return P;},getViewportWidth:function(){var P=self.innerWidth;var Q=M.compatMode;if(Q||G){P=(Q=="CSS1Compat")?M.documentElement.clientWidth:M.body.clientWidth;}return P;},getAncestorBy:function(P,Q){while(P=P.parentNode){if(D(P,Q)){return P;}}return null;},getAncestorByClassName:function(Q,P){Q=B.Dom.get(Q);if(!Q){return null;}var R=function(S){return B.Dom.hasClass(S,P);};return B.Dom.getAncestorBy(Q,R);},getAncestorByTagName:function(Q,P){Q=B.Dom.get(Q);if(!Q){return null;}var R=function(S){return S.tagName&&S.tagName.toUpperCase()==P.toUpperCase();};return B.Dom.getAncestorBy(Q,R);},getPreviousSiblingBy:function(P,Q){while(P){P=P.previousSibling;if(D(P,Q)){return P;}}return null;},getPreviousSibling:function(P){P=B.Dom.get(P);if(!P){return null;}return B.Dom.getPreviousSiblingBy(P);},getNextSiblingBy:function(P,Q){while(P){P=P.nextSibling;if(D(P,Q)){return P;}}return null;},getNextSibling:function(P){P=B.Dom.get(P);if(!P){return null;}return B.Dom.getNextSiblingBy(P);},getFirstChildBy:function(P,R){var Q=(D(P.firstChild,R))?P.firstChild:null;return Q||B.Dom.getNextSiblingBy(P.firstChild,R);},getFirstChild:function(P,Q){P=B.Dom.get(P);if(!P){return null;}return B.Dom.getFirstChildBy(P);},getLastChildBy:function(P,R){if(!P){return null;}var Q=(D(P.lastChild,R))?P.lastChild:null;return Q||B.Dom.getPreviousSiblingBy(P.lastChild,R);},getLastChild:function(P){P=B.Dom.get(P);return B.Dom.getLastChildBy(P);},getChildrenBy:function(Q,S){var R=B.Dom.getFirstChildBy(Q,S);var P=R?[R]:[];B.Dom.getNextSiblingBy(R,function(T){if(!S||S(T)){P[P.length]=T;}return false;});return P;},getChildren:function(P){P=B.Dom.get(P);if(!P){}return B.Dom.getChildrenBy(P);},getDocumentScrollLeft:function(P){P=P||M;return Math.max(P.documentElement.scrollLeft,P.body.scrollLeft);},getDocumentScrollTop:function(P){P=P||M;return Math.max(P.documentElement.scrollTop,P.body.scrollTop);},insertBefore:function(Q,P){Q=B.Dom.get(Q);P=B.Dom.get(P);if(!Q||!P||!P.parentNode){return null;}return P.parentNode.insertBefore(Q,P);},insertAfter:function(Q,P){Q=B.Dom.get(Q);P=B.Dom.get(P);if(!Q||!P||!P.parentNode){return null;}if(P.nextSibling){return P.parentNode.insertBefore(Q,P.nextSibling);}else{return P.parentNode.appendChild(Q);}},getClientRegion:function(){var R=B.Dom.getDocumentScrollTop(),Q=B.Dom.getDocumentScrollLeft(),S=B.Dom.getViewportWidth()+Q,P=B.Dom.getViewportHeight()+R;return new B.Region(R,S,P,Q);}};var H=function(){if(M.documentElement.getBoundingClientRect){return function(Q){var R=Q.getBoundingClientRect();var P=Q.ownerDocument;return[R.left+B.Dom.getDocumentScrollLeft(P),R.top+B.Dom.getDocumentScrollTop(P)];};}else{return function(R){var S=[R.offsetLeft,R.offsetTop];var Q=R.offsetParent;var P=(L&&B.Dom.getStyle(R,"position")=="absolute"&&R.offsetParent==R.ownerDocument.body);if(Q!=R){while(Q){S[0]+=Q.offsetLeft;S[1]+=Q.offsetTop;if(!P&&L&&B.Dom.getStyle(Q,"position")=="absolute"){P=true;}Q=Q.offsetParent;}}if(P){S[0]-=R.ownerDocument.body.offsetLeft;S[1]-=R.ownerDocument.body.offsetTop;}Q=R.parentNode;while(Q.tagName&&!E.ROOT_TAG.test(Q.tagName)){if(Q.scrollTop||Q.scrollLeft){if(!E.OP_SCROLL.test(B.Dom.getStyle(Q,"display"))){if(!C||B.Dom.getStyle(Q,"overflow")!=="visible"){S[0]-=Q.scrollLeft;S[1]-=Q.scrollTop;}}}Q=Q.parentNode;}return S;};}}();})();YAHOO.util.Region=function(C,D,A,B){this.top=C;this[1]=C;this.right=D;this.bottom=A;this.left=B;this[0]=B;};YAHOO.util.Region.prototype.contains=function(A){return(A.left>=this.left&&A.right<=this.right&&A.top>=this.top&&A.bottom<=this.bottom);};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left));};YAHOO.util.Region.prototype.intersect=function(E){var C=Math.max(this.top,E.top);var D=Math.min(this.right,E.right);var A=Math.min(this.bottom,E.bottom);var B=Math.max(this.left,E.left);if(A>=C&&D>=B){return new YAHOO.util.Region(C,D,A,B);}else{return null;}};YAHOO.util.Region.prototype.union=function(E){var C=Math.min(this.top,E.top);var D=Math.max(this.right,E.right);var A=Math.max(this.bottom,E.bottom);var B=Math.min(this.left,E.left);return new YAHOO.util.Region(C,D,A,B);};YAHOO.util.Region.prototype.toString=function(){return("Region {"+"top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+"}");};YAHOO.util.Region.getRegion=function(D){var F=YAHOO.util.Dom.getXY(D);var C=F[1];var E=F[0]+D.offsetWidth;var A=F[1]+D.offsetHeight;var B=F[0];return new YAHOO.util.Region(C,E,A,B);};YAHOO.util.Point=function(A,B){if(YAHOO.lang.isArray(A)){B=A[1];A=A[0];}this.x=this.right=this.left=this[0]=A;this.y=this.top=this.bottom=this[1]=B;};YAHOO.util.Point.prototype=new YAHOO.util.Region();YAHOO.register("dom",YAHOO.util.Dom,{version:"2.5.1",build:"984"});YAHOO.namespace("lang");YAHOO.lang.JSON={_ESCAPES:/\\["\\\/bfnrtu]/g,_VALUES:/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,_BRACKETS:/(?:^|:|,)(?:\s*\[)+/g,_INVALID:/^[\],:{}\s]*$/,_SPECIAL_CHARS:/["\\\x00-\x1f\x7f-\x9f]/g,_PARSE_DATE:/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})Z$/,_CHARS:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},_applyFilter:function(C,B){var A=function(E,D){var F,G;if(D&&typeof D==="object"){for(F in D){if(YAHOO.lang.hasOwnProperty(D,F)){G=A(F,D[F]);if(G===undefined){delete D[F];}else{D[F]=G;}}}}return B(E,D);};if(YAHOO.lang.isFunction(B)){A("",C);}return C;},isValid:function(A){if(!YAHOO.lang.isString(A)){return false;}return this._INVALID.test(A.replace(this._ESCAPES,"@").replace(this._VALUES,"]").replace(this._BRACKETS,""));},dateToString:function(B){function A(C){return C<10?"0"+C:C;}return'"'+B.getUTCFullYear()+"-"+A(B.getUTCMonth()+1)+"-"+A(B.getUTCDate())+"T"+A(B.getUTCHours())+":"+A(B.getUTCMinutes())+":"+A(B.getUTCSeconds())+'Z"';},stringToDate:function(B){if(this._PARSE_DATE.test(B)){var A=new Date();A.setUTCFullYear(RegExp.$1,(RegExp.$2|0)-1,RegExp.$3);A.setUTCHours(RegExp.$4,RegExp.$5,RegExp.$6);return A;}},parse:function(s,filter){if(this.isValid(s)){return this._applyFilter(eval("("+s+")"),filter);}throw new SyntaxError("parseJSON");},stringify:function(C,K,F){var E=YAHOO.lang,H=E.JSON,D=H._CHARS,A=this._SPECIAL_CHARS,B=[];var I=function(N){if(!D[N]){var J=N.charCodeAt();D[N]="\\u00"+Math.floor(J/16).toString(16)+(J%16).toString(16);}return D[N];};var M=function(J){return'"'+J.replace(A,I)+'"';};var L=H.dateToString;var G=function(J,T,R){var W=typeof J,P,Q,O,N,U,V,S;if(W==="string"){return M(J);}if(W==="boolean"||J instanceof Boolean){return String(J);}if(W==="number"||J instanceof Number){return isFinite(J)?String(J):"null";}if(J instanceof Date){return L(J);}if(E.isArray(J)){for(P=B.length-1;P>=0;--P){if(B[P]===J){return"null";}}B[B.length]=J;S=[];if(R>0){for(P=J.length-1;P>=0;--P){S[P]=G(J[P],T,R-1)||"null";}}B.pop();return"["+S.join(",")+"]";}if(W==="object"){if(!J){return"null";}for(P=B.length-1;P>=0;--P){if(B[P]===J){return"null";}}B[B.length]=J;S=[];if(R>0){if(T){for(P=0,O=0,Q=T.length;P<Q;++P){if(typeof T[P]==="string"){U=G(J[T[P]],T,R-1);if(U){S[O++]=M(T[P])+":"+U;}}}}else{O=0;for(N in J){if(typeof N==="string"&&E.hasOwnProperty(J,N)){U=G(J[N],T,R-1);if(U){S[O++]=M(N)+":"+U;}}}}}B.pop();return"{"+S.join(",")+"}";}return undefined;};F=F>=0?F:1/0;return G(C,K,F);}};YAHOO.register("json",YAHOO.lang.JSON,{version:"2.5.1",build:"984"});if(!YAHOO.util.DragDropMgr){YAHOO.util.DragDropMgr=function(){var A=YAHOO.util.Event;return{ids:{},handleIds:{},dragCurrent:null,dragOvers:{},deltaX:0,deltaY:0,preventDefault:true,stopPropagation:true,initialized:false,locked:false,interactionInfo:null,init:function(){this.initialized=true;},POINT:0,INTERSECT:1,STRICT_INTERSECT:2,mode:0,_execOnAll:function(D,C){for(var E in this.ids){for(var B in this.ids[E]){var F=this.ids[E][B];if(!this.isTypeOfDD(F)){continue;}F[D].apply(F,C);}}},_onLoad:function(){this.init();A.on(document,"mouseup",this.handleMouseUp,this,true);A.on(document,"mousemove",this.handleMouseMove,this,true);A.on(window,"unload",this._onUnload,this,true);A.on(window,"resize",this._onResize,this,true);},_onResize:function(B){this._execOnAll("resetConstraints",[]);},lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isLocked:function(){return this.locked;},locationCache:{},useCache:true,clickPixelThresh:3,clickTimeThresh:1000,dragThreshMet:false,clickTimeout:null,startX:0,startY:0,fromTimeout:false,regDragDrop:function(C,B){if(!this.initialized){this.init();}if(!this.ids[B]){this.ids[B]={};}this.ids[B][C.id]=C;},removeDDFromGroup:function(D,B){if(!this.ids[B]){this.ids[B]={};}var C=this.ids[B];if(C&&C[D.id]){delete C[D.id];}},_remove:function(C){for(var B in C.groups){if(B&&this.ids[B][C.id]){delete this.ids[B][C.id];}}delete this.handleIds[C.id];},regHandle:function(C,B){if(!this.handleIds[C]){this.handleIds[C]={};}this.handleIds[C][B]=B;},isDragDrop:function(B){return(this.getDDById(B))?true:false;},getRelated:function(G,C){var F=[];for(var E in G.groups){for(var D in this.ids[E]){var B=this.ids[E][D];if(!this.isTypeOfDD(B)){continue;}if(!C||B.isTarget){F[F.length]=B;}}}return F;},isLegalTarget:function(F,E){var C=this.getRelated(F,true);for(var D=0,B=C.length;D<B;++D){if(C[D].id==E.id){return true;}}return false;},isTypeOfDD:function(B){return(B&&B.__ygDragDrop);},isHandle:function(C,B){return(this.handleIds[C]&&this.handleIds[C][B]);},getDDById:function(C){for(var B in this.ids){if(this.ids[B][C]){return this.ids[B][C];}}return null;},handleMouseDown:function(D,C){this.currentTarget=YAHOO.util.Event.getTarget(D);this.dragCurrent=C;var B=C.getEl();this.startX=YAHOO.util.Event.getPageX(D);this.startY=YAHOO.util.Event.getPageY(D);this.deltaX=this.startX-B.offsetLeft;this.deltaY=this.startY-B.offsetTop;this.dragThreshMet=false;this.clickTimeout=setTimeout(function(){var E=YAHOO.util.DDM;E.startDrag(E.startX,E.startY);E.fromTimeout=true;},this.clickTimeThresh);},startDrag:function(B,D){clearTimeout(this.clickTimeout);var C=this.dragCurrent;if(C&&C.events.b4StartDrag){C.b4StartDrag(B,D);C.fireEvent("b4StartDragEvent",{x:B,y:D});}if(C&&C.events.startDrag){C.startDrag(B,D);C.fireEvent("startDragEvent",{x:B,y:D});}this.dragThreshMet=true;},handleMouseUp:function(B){if(this.dragCurrent){clearTimeout(this.clickTimeout);if(this.dragThreshMet){if(this.fromTimeout){this.handleMouseMove(B);}this.fromTimeout=false;this.fireEvents(B,true);}else{}this.stopDrag(B);this.stopEvent(B);}},stopEvent:function(B){if(this.stopPropagation){YAHOO.util.Event.stopPropagation(B);}if(this.preventDefault){YAHOO.util.Event.preventDefault(B);}},stopDrag:function(D,C){var B=this.dragCurrent;if(B&&!C){if(this.dragThreshMet){if(B.events.b4EndDrag){B.b4EndDrag(D);B.fireEvent("b4EndDragEvent",{e:D});}if(B.events.endDrag){B.endDrag(D);B.fireEvent("endDragEvent",{e:D});}}if(B.events.mouseUp){B.onMouseUp(D);B.fireEvent("mouseUpEvent",{e:D});}}this.dragCurrent=null;this.dragOvers={};},handleMouseMove:function(E){var B=this.dragCurrent;if(B){if(YAHOO.util.Event.isIE&&!E.button){this.stopEvent(E);return this.handleMouseUp(E);}else{if(E.clientX<0||E.clientY<0){}}if(!this.dragThreshMet){var D=Math.abs(this.startX-YAHOO.util.Event.getPageX(E));var C=Math.abs(this.startY-YAHOO.util.Event.getPageY(E));if(D>this.clickPixelThresh||C>this.clickPixelThresh){this.startDrag(this.startX,this.startY);}}if(this.dragThreshMet){if(B&&B.events.b4Drag){B.b4Drag(E);B.fireEvent("b4DragEvent",{e:E});}if(B&&B.events.drag){B.onDrag(E);B.fireEvent("dragEvent",{e:E});}if(B){this.fireEvents(E,false);}}this.stopEvent(E);}},fireEvents:function(U,K){var Z=this.dragCurrent;if(!Z||Z.isLocked()||Z.dragOnly){return;}var M=YAHOO.util.Event.getPageX(U),L=YAHOO.util.Event.getPageY(U),O=new YAHOO.util.Point(M,L),J=Z.getTargetCoord(O.x,O.y),E=Z.getDragEl(),D=["out","over","drop","enter"],T=new YAHOO.util.Region(J.y,J.x+E.offsetWidth,J.y+E.offsetHeight,J.x),H=[],C={},P=[],a={outEvts:[],overEvts:[],dropEvts:[],enterEvts:[]};for(var R in this.dragOvers){var c=this.dragOvers[R];if(!this.isTypeOfDD(c)){continue;}if(!this.isOverTarget(O,c,this.mode,T)){a.outEvts.push(c);}H[R]=true;delete this.dragOvers[R];}for(var Q in Z.groups){if("string"!=typeof Q){continue;}for(R in this.ids[Q]){var F=this.ids[Q][R];if(!this.isTypeOfDD(F)){continue;}if(F.isTarget&&!F.isLocked()&&F!=Z){if(this.isOverTarget(O,F,this.mode,T)){C[Q]=true;if(K){a.dropEvts.push(F);}else{if(!H[F.id]){a.enterEvts.push(F);}else{a.overEvts.push(F);}this.dragOvers[F.id]=F;}}}}}this.interactionInfo={out:a.outEvts,enter:a.enterEvts,over:a.overEvts,drop:a.dropEvts,point:O,draggedRegion:T,sourceRegion:this.locationCache[Z.id],validDrop:K};for(var B in C){P.push(B);}if(K&&!a.dropEvts.length){this.interactionInfo.validDrop=false;if(Z.events.invalidDrop){Z.onInvalidDrop(U);Z.fireEvent("invalidDropEvent",{e:U});}}for(R=0;R<D.length;R++){var X=null;if(a[D[R]+"Evts"]){X=a[D[R]+"Evts"];}if(X&&X.length){var G=D[R].charAt(0).toUpperCase()+D[R].substr(1),W="onDrag"+G,I="b4Drag"+G,N="drag"+G+"Event",V="drag"+G;if(this.mode){if(Z.events[I]){Z[I](U,X,P);Z.fireEvent(I+"Event",{event:U,info:X,group:P});}if(Z.events[V]){Z[W](U,X,P);Z.fireEvent(N,{event:U,info:X,group:P});}}else{for(var Y=0,S=X.length;Y<S;++Y){if(Z.events[I]){Z[I](U,X[Y].id,P[0]);Z.fireEvent(I+"Event",{event:U,info:X[Y].id,group:P[0]});}if(Z.events[V]){Z[W](U,X[Y].id,P[0]);Z.fireEvent(N,{event:U,info:X[Y].id,group:P[0]});}}}}}},getBestMatch:function(D){var F=null;var C=D.length;if(C==1){F=D[0];}else{for(var E=0;E<C;++E){var B=D[E];if(this.mode==this.INTERSECT&&B.cursorIsOver){F=B;break;}else{if(!F||!F.overlap||(B.overlap&&F.overlap.getArea()<B.overlap.getArea())){F=B;}}}}return F;},refreshCache:function(C){var E=C||this.ids;for(var B in E){if("string"!=typeof B){continue;}for(var D in this.ids[B]){var F=this.ids[B][D];if(this.isTypeOfDD(F)){var G=this.getLocation(F);if(G){this.locationCache[F.id]=G;}else{delete this.locationCache[F.id];}}}}},verifyEl:function(C){try{if(C){var B=C.offsetParent;if(B){return true;}}}catch(D){}return false;},getLocation:function(G){if(!this.isTypeOfDD(G)){return null;}var E=G.getEl(),J,D,C,L,K,M,B,I,F;try{J=YAHOO.util.Dom.getXY(E);}catch(H){}if(!J){return null;}D=J[0];C=D+E.offsetWidth;L=J[1];K=L+E.offsetHeight;M=L-G.padding[0];B=C+G.padding[1];I=K+G.padding[2];F=D-G.padding[3];return new YAHOO.util.Region(M,B,I,F);},isOverTarget:function(J,B,D,E){var F=this.locationCache[B.id];if(!F||!this.useCache){F=this.getLocation(B);this.locationCache[B.id]=F;}if(!F){return false;}B.cursorIsOver=F.contains(J);var I=this.dragCurrent;if(!I||(!D&&!I.constrainX&&!I.constrainY)){return B.cursorIsOver;}B.overlap=null;if(!E){var G=I.getTargetCoord(J.x,J.y);var C=I.getDragEl();E=new YAHOO.util.Region(G.y,G.x+C.offsetWidth,G.y+C.offsetHeight,G.x);}var H=E.intersect(F);if(H){B.overlap=H;return(D)?true:B.cursorIsOver;}else{return false;}},_onUnload:function(C,B){this.unregAll();},unregAll:function(){if(this.dragCurrent){this.stopDrag();this.dragCurrent=null;}this._execOnAll("unreg",[]);this.ids={};},elementCache:{},getElWrapper:function(C){var B=this.elementCache[C];if(!B||!B.el){B=this.elementCache[C]=new this.ElementWrapper(YAHOO.util.Dom.get(C));}return B;},getElement:function(B){return YAHOO.util.Dom.get(B);},getCss:function(C){var B=YAHOO.util.Dom.get(C);return(B)?B.style:null;},ElementWrapper:function(B){this.el=B||null;this.id=this.el&&B.id;this.css=this.el&&B.style;},getPosX:function(B){return YAHOO.util.Dom.getX(B);},getPosY:function(B){return YAHOO.util.Dom.getY(B);},swapNode:function(D,B){if(D.swapNode){D.swapNode(B);}else{var E=B.parentNode;var C=B.nextSibling;if(C==D){E.insertBefore(D,B);}else{if(B==D.nextSibling){E.insertBefore(B,D);}else{D.parentNode.replaceChild(B,D);E.insertBefore(D,C);}}}},getScroll:function(){var D,B,E=document.documentElement,C=document.body;if(E&&(E.scrollTop||E.scrollLeft)){D=E.scrollTop;B=E.scrollLeft;}else{if(C){D=C.scrollTop;B=C.scrollLeft;}else{}}return{top:D,left:B};},getStyle:function(C,B){return YAHOO.util.Dom.getStyle(C,B);},getScrollTop:function(){return this.getScroll().top;},getScrollLeft:function(){return this.getScroll().left;},moveToEl:function(B,D){var C=YAHOO.util.Dom.getXY(D);YAHOO.util.Dom.setXY(B,C);},getClientHeight:function(){return YAHOO.util.Dom.getViewportHeight();},getClientWidth:function(){return YAHOO.util.Dom.getViewportWidth();},numericSort:function(C,B){return(C-B);},_timeoutCount:0,_addListeners:function(){var B=YAHOO.util.DDM;if(YAHOO.util.Event&&document){B._onLoad();}else{if(B._timeoutCount>2000){}else{setTimeout(B._addListeners,10);if(document&&document.body){B._timeoutCount+=1;}}}},handleWasClicked:function(B,D){if(this.isHandle(D,B.id)){return true;}else{var C=B.parentNode;while(C){if(this.isHandle(D,C.id)){return true;}else{C=C.parentNode;}}}return false;}};}();YAHOO.util.DDM=YAHOO.util.DragDropMgr;YAHOO.util.DDM._addListeners();}(function(){var A=YAHOO.util.Event;var B=YAHOO.util.Dom;YAHOO.util.DragDrop=function(E,C,D){if(E){this.init(E,C,D);}};YAHOO.util.DragDrop.prototype={events:null,on:function(){this.subscribe.apply(this,arguments);},id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isTarget:true,padding:null,dragOnly:false,_domRef:null,__ygDragDrop:true,constrainX:false,constrainY:false,minX:0,maxX:0,minY:0,maxY:0,deltaX:0,deltaY:0,maintainOffset:false,xTicks:null,yTicks:null,primaryButtonOnly:true,available:false,hasOuterHandles:false,cursorIsOver:false,overlap:null,b4StartDrag:function(C,D){},startDrag:function(C,D){},b4Drag:function(C){},onDrag:function(C){},onDragEnter:function(C,D){},b4DragOver:function(C){},onDragOver:function(C,D){},b4DragOut:function(C){},onDragOut:function(C,D){},b4DragDrop:function(C){},onDragDrop:function(C,D){},onInvalidDrop:function(C){},b4EndDrag:function(C){},endDrag:function(C){},b4MouseDown:function(C){},onMouseDown:function(C){},onMouseUp:function(C){},onAvailable:function(){},getEl:function(){if(!this._domRef){this._domRef=B.get(this.id);}return this._domRef;},getDragEl:function(){return B.get(this.dragElId);},init:function(F,C,D){this.initTarget(F,C,D);A.on(this._domRef||this.id,"mousedown",this.handleMouseDown,this,true);for(var E in this.events){this.createEvent(E+"Event");}},initTarget:function(E,C,D){this.config=D||{};this.events={};this.DDM=YAHOO.util.DDM;this.groups={};if(typeof E!=="string"){this._domRef=E;E=B.generateId(E);}this.id=E;this.addToGroup((C)?C:"default");this.handleElId=E;A.onAvailable(E,this.handleOnAvailable,this,true);this.setDragElId(E);this.invalidHandleTypes={A:"A"};this.invalidHandleIds={};this.invalidHandleClasses=[];this.applyConfig();},applyConfig:function(){this.events={mouseDown:true,b4MouseDown:true,mouseUp:true,b4StartDrag:true,startDrag:true,b4EndDrag:true,endDrag:true,drag:true,b4Drag:true,invalidDrop:true,b4DragOut:true,dragOut:true,dragEnter:true,b4DragOver:true,dragOver:true,b4DragDrop:true,dragDrop:true};if(this.config.events){for(var C in this.config.events){if(this.config.events[C]===false){this.events[C]=false;}}}this.padding=this.config.padding||[0,0,0,0];this.isTarget=(this.config.isTarget!==false);this.maintainOffset=(this.config.maintainOffset);this.primaryButtonOnly=(this.config.primaryButtonOnly!==false);this.dragOnly=((this.config.dragOnly===true)?true:false);},handleOnAvailable:function(){this.available=true;this.resetConstraints();this.onAvailable();},setPadding:function(E,C,F,D){if(!C&&0!==C){this.padding=[E,E,E,E];}else{if(!F&&0!==F){this.padding=[E,C,E,C];}else{this.padding=[E,C,F,D];}}},setInitPosition:function(F,E){var G=this.getEl();if(!this.DDM.verifyEl(G)){if(G&&G.style&&(G.style.display=="none")){}else{}return;}var D=F||0;var C=E||0;var H=B.getXY(G);this.initPageX=H[0]-D;this.initPageY=H[1]-C;this.lastPageX=H[0];this.lastPageY=H[1];this.setStartPosition(H);},setStartPosition:function(D){var C=D||B.getXY(this.getEl());this.deltaSetXY=null;this.startPageX=C[0];this.startPageY=C[1];},addToGroup:function(C){this.groups[C]=true;this.DDM.regDragDrop(this,C);},removeFromGroup:function(C){if(this.groups[C]){delete this.groups[C];}this.DDM.removeDDFromGroup(this,C);},setDragElId:function(C){this.dragElId=C;},setHandleElId:function(C){if(typeof C!=="string"){C=B.generateId(C);}this.handleElId=C;this.DDM.regHandle(this.id,C);},setOuterHandleElId:function(C){if(typeof C!=="string"){C=B.generateId(C);}A.on(C,"mousedown",this.handleMouseDown,this,true);this.setHandleElId(C);this.hasOuterHandles=true;},unreg:function(){A.removeListener(this.id,"mousedown",this.handleMouseDown);this._domRef=null;this.DDM._remove(this);},isLocked:function(){return(this.DDM.isLocked()||this.locked);},handleMouseDown:function(H,G){var D=H.which||H.button;if(this.primaryButtonOnly&&D>1){return;}if(this.isLocked()){return;}var C=this.b4MouseDown(H);if(this.events.b4MouseDown){C=this.fireEvent("b4MouseDownEvent",H);}var E=this.onMouseDown(H);if(this.events.mouseDown){E=this.fireEvent("mouseDownEvent",H);}if((C===false)||(E===false)){return;}this.DDM.refreshCache(this.groups);var F=new YAHOO.util.Point(A.getPageX(H),A.getPageY(H));if(!this.hasOuterHandles&&!this.DDM.isOverTarget(F,this)){}else{if(this.clickValidator(H)){this.setStartPosition();this.DDM.handleMouseDown(H,this);this.DDM.stopEvent(H);}else{}}},clickValidator:function(D){var C=YAHOO.util.Event.getTarget(D);return(this.isValidHandleChild(C)&&(this.id==this.handleElId||this.DDM.handleWasClicked(C,this.id)));},getTargetCoord:function(E,D){var C=E-this.deltaX;var F=D-this.deltaY;if(this.constrainX){if(C<this.minX){C=this.minX;}if(C>this.maxX){C=this.maxX;}}if(this.constrainY){if(F<this.minY){F=this.minY;}if(F>this.maxY){F=this.maxY;}}C=this.getTick(C,this.xTicks);F=this.getTick(F,this.yTicks);return{x:C,y:F};},addInvalidHandleType:function(C){var D=C.toUpperCase();this.invalidHandleTypes[D]=D;},addInvalidHandleId:function(C){if(typeof C!=="string"){C=B.generateId(C);}this.invalidHandleIds[C]=C;},addInvalidHandleClass:function(C){this.invalidHandleClasses.push(C);},removeInvalidHandleType:function(C){var D=C.toUpperCase();delete this.invalidHandleTypes[D];},removeInvalidHandleId:function(C){if(typeof C!=="string"){C=B.generateId(C);}delete this.invalidHandleIds[C];},removeInvalidHandleClass:function(D){for(var E=0,C=this.invalidHandleClasses.length;E<C;++E){if(this.invalidHandleClasses[E]==D){delete this.invalidHandleClasses[E];}}},isValidHandleChild:function(F){var E=true;var H;try{H=F.nodeName.toUpperCase();}catch(G){H=F.nodeName;}E=E&&!this.invalidHandleTypes[H];E=E&&!this.invalidHandleIds[F.id];for(var D=0,C=this.invalidHandleClasses.length;E&&D<C;++D){E=!B.hasClass(F,this.invalidHandleClasses[D]);}return E;},setXTicks:function(F,C){this.xTicks=[];this.xTickSize=C;var E={};for(var D=this.initPageX;D>=this.minX;D=D-C){if(!E[D]){this.xTicks[this.xTicks.length]=D;E[D]=true;}}for(D=this.initPageX;D<=this.maxX;D=D+C){if(!E[D]){this.xTicks[this.xTicks.length]=D;E[D]=true;}}this.xTicks.sort(this.DDM.numericSort);},setYTicks:function(F,C){this.yTicks=[];this.yTickSize=C;var E={};for(var D=this.initPageY;D>=this.minY;D=D-C){if(!E[D]){this.yTicks[this.yTicks.length]=D;E[D]=true;}}for(D=this.initPageY;D<=this.maxY;D=D+C){if(!E[D]){this.yTicks[this.yTicks.length]=D;E[D]=true;}}this.yTicks.sort(this.DDM.numericSort);},setXConstraint:function(E,D,C){this.leftConstraint=parseInt(E,10);this.rightConstraint=parseInt(D,10);this.minX=this.initPageX-this.leftConstraint;this.maxX=this.initPageX+this.rightConstraint;if(C){this.setXTicks(this.initPageX,C);}this.constrainX=true;},clearConstraints:function(){this.constrainX=false;this.constrainY=false;this.clearTicks();},clearTicks:function(){this.xTicks=null;this.yTicks=null;this.xTickSize=0;this.yTickSize=0;},setYConstraint:function(C,E,D){this.topConstraint=parseInt(C,10);this.bottomConstraint=parseInt(E,10);this.minY=this.initPageY-this.topConstraint;this.maxY=this.initPageY+this.bottomConstraint;if(D){this.setYTicks(this.initPageY,D);}this.constrainY=true;},resetConstraints:function(){if(this.initPageX||this.initPageX===0){var D=(this.maintainOffset)?this.lastPageX-this.initPageX:0;var C=(this.maintainOffset)?this.lastPageY-this.initPageY:0;this.setInitPosition(D,C);}else{this.setInitPosition();}if(this.constrainX){this.setXConstraint(this.leftConstraint,this.rightConstraint,this.xTickSize);}if(this.constrainY){this.setYConstraint(this.topConstraint,this.bottomConstraint,this.yTickSize);}},getTick:function(I,F){if(!F){return I;}else{if(F[0]>=I){return F[0];}else{for(var D=0,C=F.length;D<C;++D){var E=D+1;if(F[E]&&F[E]>=I){var H=I-F[D];var G=F[E]-I;return(G>H)?F[D]:F[E];}}return F[F.length-1];}}},toString:function(){return("DragDrop "+this.id);}};YAHOO.augment(YAHOO.util.DragDrop,YAHOO.util.EventProvider);})();YAHOO.util.DD=function(C,A,B){if(C){this.init(C,A,B);}};YAHOO.extend(YAHOO.util.DD,YAHOO.util.DragDrop,{scroll:true,autoOffset:function(C,B){var A=C-this.startPageX;var D=B-this.startPageY;this.setDelta(A,D);},setDelta:function(B,A){this.deltaX=B;this.deltaY=A;},setDragElPos:function(C,B){var A=this.getDragEl();this.alignElWithMouse(A,C,B);},alignElWithMouse:function(C,G,F){var E=this.getTargetCoord(G,F);if(!this.deltaSetXY){var H=[E.x,E.y];YAHOO.util.Dom.setXY(C,H);var D=parseInt(YAHOO.util.Dom.getStyle(C,"left"),10);var B=parseInt(YAHOO.util.Dom.getStyle(C,"top"),10);this.deltaSetXY=[D-E.x,B-E.y];}else{YAHOO.util.Dom.setStyle(C,"left",(E.x+this.deltaSetXY[0])+"px");YAHOO.util.Dom.setStyle(C,"top",(E.y+this.deltaSetXY[1])+"px");}this.cachePosition(E.x,E.y);var A=this;setTimeout(function(){A.autoScroll.call(A,E.x,E.y,C.offsetHeight,C.offsetWidth);},0);},cachePosition:function(B,A){if(B){this.lastPageX=B;this.lastPageY=A;}else{var C=YAHOO.util.Dom.getXY(this.getEl());this.lastPageX=C[0];this.lastPageY=C[1];}},autoScroll:function(J,I,E,K){if(this.scroll){var L=this.DDM.getClientHeight();var B=this.DDM.getClientWidth();var N=this.DDM.getScrollTop();var D=this.DDM.getScrollLeft();var H=E+I;var M=K+J;var G=(L+N-I-this.deltaY);var F=(B+D-J-this.deltaX);var C=40;var A=(document.all)?80:30;if(H>L&&G<C){window.scrollTo(D,N+A);}if(I<N&&N>0&&I-N<C){window.scrollTo(D,N-A);}if(M>B&&F<C){window.scrollTo(D+A,N);}if(J<D&&D>0&&J-D<C){window.scrollTo(D-A,N);}}},applyConfig:function(){YAHOO.util.DD.superclass.applyConfig.call(this);this.scroll=(this.config.scroll!==false);},b4MouseDown:function(A){this.setStartPosition();this.autoOffset(YAHOO.util.Event.getPageX(A),YAHOO.util.Event.getPageY(A));},b4Drag:function(A){this.setDragElPos(YAHOO.util.Event.getPageX(A),YAHOO.util.Event.getPageY(A));},toString:function(){return("DD "+this.id);}});YAHOO.util.DDProxy=function(C,A,B){if(C){this.init(C,A,B);this.initFrame();}};YAHOO.util.DDProxy.dragElId="ygddfdiv";YAHOO.extend(YAHOO.util.DDProxy,YAHOO.util.DD,{resizeFrame:true,centerFrame:false,createFrame:function(){var B=this,A=document.body;if(!A||!A.firstChild){setTimeout(function(){B.createFrame();},50);return;}var G=this.getDragEl(),E=YAHOO.util.Dom;if(!G){G=document.createElement("div");G.id=this.dragElId;var D=G.style;D.position="absolute";D.visibility="hidden";D.cursor="move";D.border="2px solid #aaa";D.zIndex=999;D.height="25px";D.width="25px";var C=document.createElement("div");E.setStyle(C,"height","100%");E.setStyle(C,"width","100%");E.setStyle(C,"background-color","#ccc");E.setStyle(C,"opacity","0");G.appendChild(C);if(YAHOO.env.ua.ie){var F=document.createElement("iframe");F.setAttribute("src","javascript: false;");F.setAttribute("scrolling","no");F.setAttribute("frameborder","0");G.insertBefore(F,G.firstChild);E.setStyle(F,"height","100%");E.setStyle(F,"width","100%");E.setStyle(F,"position","absolute");E.setStyle(F,"top","0");E.setStyle(F,"left","0");E.setStyle(F,"opacity","0");E.setStyle(F,"zIndex","-1");E.setStyle(F.nextSibling,"zIndex","2");}A.insertBefore(G,A.firstChild);}},initFrame:function(){this.createFrame();},applyConfig:function(){YAHOO.util.DDProxy.superclass.applyConfig.call(this);this.resizeFrame=(this.config.resizeFrame!==false);this.centerFrame=(this.config.centerFrame);this.setDragElId(this.config.dragElId||YAHOO.util.DDProxy.dragElId);},showFrame:function(E,D){var C=this.getEl();var A=this.getDragEl();var B=A.style;this._resizeProxy();if(this.centerFrame){this.setDelta(Math.round(parseInt(B.width,10)/2),Math.round(parseInt(B.height,10)/2));}this.setDragElPos(E,D);YAHOO.util.Dom.setStyle(A,"visibility","visible");},_resizeProxy:function(){if(this.resizeFrame){var H=YAHOO.util.Dom;var B=this.getEl();var C=this.getDragEl();var G=parseInt(H.getStyle(C,"borderTopWidth"),10);var I=parseInt(H.getStyle(C,"borderRightWidth"),10);var F=parseInt(H.getStyle(C,"borderBottomWidth"),10);var D=parseInt(H.getStyle(C,"borderLeftWidth"),10);if(isNaN(G)){G=0;}if(isNaN(I)){I=0;}if(isNaN(F)){F=0;}if(isNaN(D)){D=0;}var E=Math.max(0,B.offsetWidth-I-D);var A=Math.max(0,B.offsetHeight-G-F);H.setStyle(C,"width",E+"px");H.setStyle(C,"height",A+"px");}},b4MouseDown:function(B){this.setStartPosition();var A=YAHOO.util.Event.getPageX(B);var C=YAHOO.util.Event.getPageY(B);this.autoOffset(A,C);},b4StartDrag:function(A,B){this.showFrame(A,B);},b4EndDrag:function(A){YAHOO.util.Dom.setStyle(this.getDragEl(),"visibility","hidden");},endDrag:function(D){var C=YAHOO.util.Dom;var B=this.getEl();var A=this.getDragEl();C.setStyle(A,"visibility","");C.setStyle(B,"visibility","hidden");YAHOO.util.DDM.moveToEl(B,A);C.setStyle(A,"visibility","hidden");C.setStyle(B,"visibility","");},toString:function(){return("DDProxy "+this.id);}});YAHOO.util.DDTarget=function(C,A,B){if(C){this.initTarget(C,A,B);}};YAHOO.extend(YAHOO.util.DDTarget,YAHOO.util.DragDrop,{toString:function(){return("DDTarget "+this.id);}});YAHOO.register("dragdrop",YAHOO.util.DragDropMgr,{version:"2.5.1",build:"984"});(function(){YAHOO.util.Config=function(D){if(D){this.init(D);}};var B=YAHOO.lang,C=YAHOO.util.CustomEvent,A=YAHOO.util.Config;A.CONFIG_CHANGED_EVENT="configChanged";A.BOOLEAN_TYPE="boolean";A.prototype={owner:null,queueInProgress:false,config:null,initialConfig:null,eventQueue:null,configChangedEvent:null,init:function(D){this.owner=D;this.configChangedEvent=this.createEvent(A.CONFIG_CHANGED_EVENT);this.configChangedEvent.signature=C.LIST;this.queueInProgress=false;this.config={};this.initialConfig={};this.eventQueue=[];},checkBoolean:function(D){return(typeof D==A.BOOLEAN_TYPE);},checkNumber:function(D){return(!isNaN(D));},fireEvent:function(D,F){var E=this.config[D];if(E&&E.event){E.event.fire(F);}},addProperty:function(E,D){E=E.toLowerCase();this.config[E]=D;D.event=this.createEvent(E,{scope:this.owner});D.event.signature=C.LIST;D.key=E;if(D.handler){D.event.subscribe(D.handler,this.owner);}this.setProperty(E,D.value,true);if(!D.suppressEvent){this.queueProperty(E,D.value);}},getConfig:function(){var D={},F,E;for(F in this.config){E=this.config[F];if(E&&E.event){D[F]=E.value;}}return D;},getProperty:function(D){var E=this.config[D.toLowerCase()];if(E&&E.event){return E.value;}else{return undefined;}},resetProperty:function(D){D=D.toLowerCase();var E=this.config[D];if(E&&E.event){if(this.initialConfig[D]&&!B.isUndefined(this.initialConfig[D])){this.setProperty(D,this.initialConfig[D]);return true;}}else{return false;}},setProperty:function(E,G,D){var F;E=E.toLowerCase();if(this.queueInProgress&&!D){this.queueProperty(E,G);return true;}else{F=this.config[E];if(F&&F.event){if(F.validator&&!F.validator(G)){return false;}else{F.value=G;if(!D){this.fireEvent(E,G);this.configChangedEvent.fire([E,G]);}return true;}}else{return false;}}},queueProperty:function(S,P){S=S.toLowerCase();var R=this.config[S],K=false,J,G,H,I,O,Q,F,M,N,D,L,T,E;if(R&&R.event){if(!B.isUndefined(P)&&R.validator&&!R.validator(P)){return false;}else{if(!B.isUndefined(P)){R.value=P;}else{P=R.value;}K=false;J=this.eventQueue.length;for(L=0;L<J;L++){G=this.eventQueue[L];if(G){H=G[0];I=G[1];if(H==S){this.eventQueue[L]=null;this.eventQueue.push([S,(!B.isUndefined(P)?P:I)]);K=true;break;}}}if(!K&&!B.isUndefined(P)){this.eventQueue.push([S,P]);}}if(R.supercedes){O=R.supercedes.length;for(T=0;T<O;T++){Q=R.supercedes[T];F=this.eventQueue.length;for(E=0;E<F;E++){M=this.eventQueue[E];if(M){N=M[0];D=M[1];if(N==Q.toLowerCase()){this.eventQueue.push([N,D]);this.eventQueue[E]=null;break;}}}}}return true;}else{return false;}},refireEvent:function(D){D=D.toLowerCase();var E=this.config[D];if(E&&E.event&&!B.isUndefined(E.value)){if(this.queueInProgress){this.queueProperty(D);}else{this.fireEvent(D,E.value);}}},applyConfig:function(D,G){var F,E;if(G){E={};for(F in D){if(B.hasOwnProperty(D,F)){E[F.toLowerCase()]=D[F];}}this.initialConfig=E;}for(F in D){if(B.hasOwnProperty(D,F)){this.queueProperty(F,D[F]);}}},refresh:function(){var D;for(D in this.config){this.refireEvent(D);}},fireQueue:function(){var E,H,D,G,F;this.queueInProgress=true;for(E=0;E<this.eventQueue.length;E++){H=this.eventQueue[E];if(H){D=H[0];G=H[1];F=this.config[D];F.value=G;this.fireEvent(D,G);}}this.queueInProgress=false;this.eventQueue=[];},subscribeToConfigEvent:function(E,F,H,D){var G=this.config[E.toLowerCase()];if(G&&G.event){if(!A.alreadySubscribed(G.event,F,H)){G.event.subscribe(F,H,D);}return true;}else{return false;}},unsubscribeFromConfigEvent:function(D,E,G){var F=this.config[D.toLowerCase()];if(F&&F.event){return F.event.unsubscribe(E,G);}else{return false;}},toString:function(){var D="Config";if(this.owner){D+=" ["+this.owner.toString()+"]";}return D;},outputEventQueue:function(){var D="",G,E,F=this.eventQueue.length;for(E=0;E<F;E++){G=this.eventQueue[E];if(G){D+=G[0]+"="+G[1]+", ";}}return D;},destroy:function(){var E=this.config,D,F;for(D in E){if(B.hasOwnProperty(E,D)){F=E[D];F.event.unsubscribeAll();F.event=null;}}this.configChangedEvent.unsubscribeAll();this.configChangedEvent=null;this.owner=null;this.config=null;this.initialConfig=null;this.eventQueue=null;}};A.alreadySubscribed=function(E,H,I){var F=E.subscribers.length,D,G;if(F>0){G=F-1;do{D=E.subscribers[G];if(D&&D.obj==I&&D.fn==H){return true;}}while(G--);}return false;};YAHOO.lang.augmentProto(A,YAHOO.util.EventProvider);}());(function(){YAHOO.widget.Module=function(Q,P){if(Q){this.init(Q,P);}else{}};var F=YAHOO.util.Dom,D=YAHOO.util.Config,M=YAHOO.util.Event,L=YAHOO.util.CustomEvent,G=YAHOO.widget.Module,H,O,N,E,A={"BEFORE_INIT":"beforeInit","INIT":"init","APPEND":"append","BEFORE_RENDER":"beforeRender","RENDER":"render","CHANGE_HEADER":"changeHeader","CHANGE_BODY":"changeBody","CHANGE_FOOTER":"changeFooter","CHANGE_CONTENT":"changeContent","DESTORY":"destroy","BEFORE_SHOW":"beforeShow","SHOW":"show","BEFORE_HIDE":"beforeHide","HIDE":"hide"},I={"VISIBLE":{key:"visible",value:true,validator:YAHOO.lang.isBoolean},"EFFECT":{key:"effect",suppressEvent:true,supercedes:["visible"]},"MONITOR_RESIZE":{key:"monitorresize",value:true},"APPEND_TO_DOCUMENT_BODY":{key:"appendtodocumentbody",value:false}};G.IMG_ROOT=null;G.IMG_ROOT_SSL=null;G.CSS_MODULE="yui-module";G.CSS_HEADER="hd";G.CSS_BODY="bd";G.CSS_FOOTER="ft";G.RESIZE_MONITOR_SECURE_URL="javascript:false;";G.textResizeEvent=new L("textResize");function K(){if(!H){H=document.createElement("div");H.innerHTML=('<div class="'+G.CSS_HEADER+'"></div>'+'<div class="'+G.CSS_BODY+'"></div><div class="'+G.CSS_FOOTER+'"></div>');O=H.firstChild;N=O.nextSibling;E=N.nextSibling;}return H;}function J(){if(!O){K();}return(O.cloneNode(false));}function B(){if(!N){K();}return(N.cloneNode(false));}function C(){if(!E){K();}return(E.cloneNode(false));}G.prototype={constructor:G,element:null,header:null,body:null,footer:null,id:null,imageRoot:G.IMG_ROOT,initEvents:function(){var P=L.LIST;this.beforeInitEvent=this.createEvent(A.BEFORE_INIT);this.beforeInitEvent.signature=P;this.initEvent=this.createEvent(A.INIT);this.initEvent.signature=P;this.appendEvent=this.createEvent(A.APPEND);this.appendEvent.signature=P;this.beforeRenderEvent=this.createEvent(A.BEFORE_RENDER);this.beforeRenderEvent.signature=P;this.renderEvent=this.createEvent(A.RENDER);this.renderEvent.signature=P;this.changeHeaderEvent=this.createEvent(A.CHANGE_HEADER);this.changeHeaderEvent.signature=P;this.changeBodyEvent=this.createEvent(A.CHANGE_BODY);this.changeBodyEvent.signature=P;this.changeFooterEvent=this.createEvent(A.CHANGE_FOOTER);this.changeFooterEvent.signature=P;this.changeContentEvent=this.createEvent(A.CHANGE_CONTENT);this.changeContentEvent.signature=P;this.destroyEvent=this.createEvent(A.DESTORY);this.destroyEvent.signature=P;this.beforeShowEvent=this.createEvent(A.BEFORE_SHOW);this.beforeShowEvent.signature=P;this.showEvent=this.createEvent(A.SHOW);this.showEvent.signature=P;this.beforeHideEvent=this.createEvent(A.BEFORE_HIDE);this.beforeHideEvent.signature=P;this.hideEvent=this.createEvent(A.HIDE);this.hideEvent.signature=P;},platform:function(){var P=navigator.userAgent.toLowerCase();if(P.indexOf("windows")!=-1||P.indexOf("win32")!=-1){return"windows";}else{if(P.indexOf("macintosh")!=-1){return"mac";}else{return false;}}}(),browser:function(){var P=navigator.userAgent.toLowerCase();if(P.indexOf("opera")!=-1){return"opera";}else{if(P.indexOf("msie 7")!=-1){return"ie7";}else{if(P.indexOf("msie")!=-1){return"ie";}else{if(P.indexOf("safari")!=-1){return"safari";}else{if(P.indexOf("gecko")!=-1){return"gecko";}else{return false;}}}}}}(),isSecure:function(){if(window.location.href.toLowerCase().indexOf("https")===0){return true;}else{return false;}}(),initDefaultConfig:function(){this.cfg.addProperty(I.VISIBLE.key,{handler:this.configVisible,value:I.VISIBLE.value,validator:I.VISIBLE.validator});this.cfg.addProperty(I.EFFECT.key,{suppressEvent:I.EFFECT.suppressEvent,supercedes:I.EFFECT.supercedes});this.cfg.addProperty(I.MONITOR_RESIZE.key,{handler:this.configMonitorResize,value:I.MONITOR_RESIZE.value});this.cfg.addProperty(I.APPEND_TO_DOCUMENT_BODY.key,{value:I.APPEND_TO_DOCUMENT_BODY.value});},init:function(U,T){var R,V;this.initEvents();this.beforeInitEvent.fire(G);this.cfg=new D(this);if(this.isSecure){this.imageRoot=G.IMG_ROOT_SSL;}if(typeof U=="string"){R=U;U=document.getElementById(U);if(!U){U=(K()).cloneNode(false);U.id=R;}}this.element=U;if(U.id){this.id=U.id;}V=this.element.firstChild;if(V){var Q=false,P=false,S=false;do{if(1==V.nodeType){if(!Q&&F.hasClass(V,G.CSS_HEADER)){this.header=V;Q=true;}else{if(!P&&F.hasClass(V,G.CSS_BODY)){this.body=V;P=true;}else{if(!S&&F.hasClass(V,G.CSS_FOOTER)){this.footer=V;S=true;}}}}}while((V=V.nextSibling));}this.initDefaultConfig();F.addClass(this.element,G.CSS_MODULE);if(T){this.cfg.applyConfig(T,true);}if(!D.alreadySubscribed(this.renderEvent,this.cfg.fireQueue,this.cfg)){this.renderEvent.subscribe(this.cfg.fireQueue,this.cfg,true);}this.initEvent.fire(G);},initResizeMonitor:function(){var Q=(YAHOO.env.ua.gecko&&this.platform=="windows");if(Q){var P=this;setTimeout(function(){P._initResizeMonitor();},0);}else{this._initResizeMonitor();}},_initResizeMonitor:function(){var P,R,T;function V(){G.textResizeEvent.fire();}if(!YAHOO.env.ua.opera){R=F.get("_yuiResizeMonitor");var U=this._supportsCWResize();if(!R){R=document.createElement("iframe");if(this.isSecure&&G.RESIZE_MONITOR_SECURE_URL&&YAHOO.env.ua.ie){R.src=G.RESIZE_MONITOR_SECURE_URL;}if(!U){T=["<html><head><script ",'type="text/javascript">',"window.onresize=function(){window.parent.","YAHOO.widget.Module.textResizeEvent.","fire();};<","/script></head>","<body></body></html>"].join("");R.src="data:text/html;charset=utf-8,"+encodeURIComponent(T);}R.id="_yuiResizeMonitor";R.style.position="absolute";R.style.visibility="hidden";var Q=document.body,S=Q.firstChild;if(S){Q.insertBefore(R,S);}else{Q.appendChild(R);}R.style.width="10em";R.style.height="10em";R.style.top=(-1*R.offsetHeight)+"px";R.style.left=(-1*R.offsetWidth)+"px";R.style.borderWidth="0";R.style.visibility="visible";if(YAHOO.env.ua.webkit){P=R.contentWindow.document;P.open();P.close();}}if(R&&R.contentWindow){G.textResizeEvent.subscribe(this.onDomResize,this,true);if(!G.textResizeInitialized){if(U){if(!M.on(R.contentWindow,"resize",V)){M.on(R,"resize",V);}}G.textResizeInitialized=true;}this.resizeMonitor=R;}}},_supportsCWResize:function(){var P=true;if(YAHOO.env.ua.gecko&&YAHOO.env.ua.gecko<=1.8){P=false;}return P;},onDomResize:function(S,R){var Q=-1*this.resizeMonitor.offsetWidth,P=-1*this.resizeMonitor.offsetHeight;this.resizeMonitor.style.top=P+"px";this.resizeMonitor.style.left=Q+"px";},setHeader:function(Q){var P=this.header||(this.header=J());if(Q.nodeName){P.innerHTML="";P.appendChild(Q);}else{P.innerHTML=Q;}this.changeHeaderEvent.fire(Q);this.changeContentEvent.fire();},appendToHeader:function(Q){var P=this.header||(this.header=J());P.appendChild(Q);this.changeHeaderEvent.fire(Q);this.changeContentEvent.fire();},setBody:function(Q){var P=this.body||(this.body=B());if(Q.nodeName){P.innerHTML="";P.appendChild(Q);}else{P.innerHTML=Q;}this.changeBodyEvent.fire(Q);this.changeContentEvent.fire();},appendToBody:function(Q){var P=this.body||(this.body=B());P.appendChild(Q);this.changeBodyEvent.fire(Q);this.changeContentEvent.fire();},setFooter:function(Q){var P=this.footer||(this.footer=C());if(Q.nodeName){P.innerHTML="";P.appendChild(Q);}else{P.innerHTML=Q;}this.changeFooterEvent.fire(Q);this.changeContentEvent.fire();},appendToFooter:function(Q){var P=this.footer||(this.footer=C());P.appendChild(Q);this.changeFooterEvent.fire(Q);this.changeContentEvent.fire();},render:function(R,P){var S=this,T;function Q(U){if(typeof U=="string"){U=document.getElementById(U);}if(U){S._addToParent(U,S.element);S.appendEvent.fire();}}this.beforeRenderEvent.fire();if(!P){P=this.element;}if(R){Q(R);}else{if(!F.inDocument(this.element)){return false;}}if(this.header&&!F.inDocument(this.header)){T=P.firstChild;if(T){P.insertBefore(this.header,T);}else{P.appendChild(this.header);}}if(this.body&&!F.inDocument(this.body)){if(this.footer&&F.isAncestor(this.moduleElement,this.footer)){P.insertBefore(this.body,this.footer);}else{P.appendChild(this.body);}}if(this.footer&&!F.inDocument(this.footer)){P.appendChild(this.footer);}this.renderEvent.fire();return true;},destroy:function(){var P,Q;if(this.element){M.purgeElement(this.element,true);P=this.element.parentNode;}if(P){P.removeChild(this.element);}this.element=null;this.header=null;this.body=null;this.footer=null;G.textResizeEvent.unsubscribe(this.onDomResize,this);this.cfg.destroy();this.cfg=null;this.destroyEvent.fire();for(Q in this){if(Q instanceof L){Q.unsubscribeAll();}}},show:function(){this.cfg.setProperty("visible",true);},hide:function(){this.cfg.setProperty("visible",false);},configVisible:function(Q,P,R){var S=P[0];if(S){this.beforeShowEvent.fire();F.setStyle(this.element,"display","block");this.showEvent.fire();}else{this.beforeHideEvent.fire();F.setStyle(this.element,"display","none");this.hideEvent.fire();}},configMonitorResize:function(R,Q,S){var P=Q[0];if(P){this.initResizeMonitor();}else{G.textResizeEvent.unsubscribe(this.onDomResize,this,true);this.resizeMonitor=null;}},_addToParent:function(P,Q){if(!this.cfg.getProperty("appendtodocumentbody")&&P===document.body&&P.firstChild){P.insertBefore(Q,P.firstChild);}else{P.appendChild(Q);}},toString:function(){return"Module "+this.id;}};YAHOO.lang.augmentProto(G,YAHOO.util.EventProvider);}());(function(){YAHOO.widget.Overlay=function(L,K){YAHOO.widget.Overlay.superclass.constructor.call(this,L,K);};var F=YAHOO.lang,I=YAHOO.util.CustomEvent,E=YAHOO.widget.Module,J=YAHOO.util.Event,D=YAHOO.util.Dom,C=YAHOO.util.Config,B=YAHOO.widget.Overlay,G,A={"BEFORE_MOVE":"beforeMove","MOVE":"move"},H={"X":{key:"x",validator:F.isNumber,suppressEvent:true,supercedes:["iframe"]},"Y":{key:"y",validator:F.isNumber,suppressEvent:true,supercedes:["iframe"]},"XY":{key:"xy",suppressEvent:true,supercedes:["iframe"]},"CONTEXT":{key:"context",suppressEvent:true,supercedes:["iframe"]},"FIXED_CENTER":{key:"fixedcenter",value:false,validator:F.isBoolean,supercedes:["iframe","visible"]},"WIDTH":{key:"width",suppressEvent:true,supercedes:["context","fixedcenter","iframe"]},"HEIGHT":{key:"height",suppressEvent:true,supercedes:["context","fixedcenter","iframe"]},"ZINDEX":{key:"zindex",value:null},"CONSTRAIN_TO_VIEWPORT":{key:"constraintoviewport",value:false,validator:F.isBoolean,supercedes:["iframe","x","y","xy"]},"IFRAME":{key:"iframe",value:(YAHOO.env.ua.ie==6?true:false),validator:F.isBoolean,supercedes:["zindex"]}};B.IFRAME_SRC="javascript:false;";B.IFRAME_OFFSET=3;B.VIEWPORT_OFFSET=10;B.TOP_LEFT="tl";B.TOP_RIGHT="tr";B.BOTTOM_LEFT="bl";B.BOTTOM_RIGHT="br";B.CSS_OVERLAY="yui-overlay";B.windowScrollEvent=new I("windowScroll");B.windowResizeEvent=new I("windowResize");B.windowScrollHandler=function(K){if(YAHOO.env.ua.ie){if(!window.scrollEnd){window.scrollEnd=-1;}clearTimeout(window.scrollEnd);window.scrollEnd=setTimeout(function(){B.windowScrollEvent.fire();},1);}else{B.windowScrollEvent.fire();}};B.windowResizeHandler=function(K){if(YAHOO.env.ua.ie){if(!window.resizeEnd){window.resizeEnd=-1;}clearTimeout(window.resizeEnd);window.resizeEnd=setTimeout(function(){B.windowResizeEvent.fire();},100);}else{B.windowResizeEvent.fire();}};B._initialized=null;if(B._initialized===null){J.on(window,"scroll",B.windowScrollHandler);J.on(window,"resize",B.windowResizeHandler);B._initialized=true;}YAHOO.extend(B,E,{init:function(L,K){B.superclass.init.call(this,L);this.beforeInitEvent.fire(B);D.addClass(this.element,B.CSS_OVERLAY);if(K){this.cfg.applyConfig(K,true);}if(this.platform=="mac"&&YAHOO.env.ua.gecko){if(!C.alreadySubscribed(this.showEvent,this.showMacGeckoScrollbars,this)){this.showEvent.subscribe(this.showMacGeckoScrollbars,this,true);}if(!C.alreadySubscribed(this.hideEvent,this.hideMacGeckoScrollbars,this)){this.hideEvent.subscribe(this.hideMacGeckoScrollbars,this,true);}}this.initEvent.fire(B);},initEvents:function(){B.superclass.initEvents.call(this);var K=I.LIST;this.beforeMoveEvent=this.createEvent(A.BEFORE_MOVE);this.beforeMoveEvent.signature=K;this.moveEvent=this.createEvent(A.MOVE);this.moveEvent.signature=K;},initDefaultConfig:function(){B.superclass.initDefaultConfig.call(this);this.cfg.addProperty(H.X.key,{handler:this.configX,validator:H.X.validator,suppressEvent:H.X.suppressEvent,supercedes:H.X.supercedes});this.cfg.addProperty(H.Y.key,{handler:this.configY,validator:H.Y.validator,suppressEvent:H.Y.suppressEvent,supercedes:H.Y.supercedes});this.cfg.addProperty(H.XY.key,{handler:this.configXY,suppressEvent:H.XY.suppressEvent,supercedes:H.XY.supercedes});this.cfg.addProperty(H.CONTEXT.key,{handler:this.configContext,suppressEvent:H.CONTEXT.suppressEvent,supercedes:H.CONTEXT.supercedes});this.cfg.addProperty(H.FIXED_CENTER.key,{handler:this.configFixedCenter,value:H.FIXED_CENTER.value,validator:H.FIXED_CENTER.validator,supercedes:H.FIXED_CENTER.supercedes});this.cfg.addProperty(H.WIDTH.key,{handler:this.configWidth,suppressEvent:H.WIDTH.suppressEvent,supercedes:H.WIDTH.supercedes});this.cfg.addProperty(H.HEIGHT.key,{handler:this.configHeight,suppressEvent:H.HEIGHT.suppressEvent,supercedes:H.HEIGHT.supercedes});this.cfg.addProperty(H.ZINDEX.key,{handler:this.configzIndex,value:H.ZINDEX.value});this.cfg.addProperty(H.CONSTRAIN_TO_VIEWPORT.key,{handler:this.configConstrainToViewport,value:H.CONSTRAIN_TO_VIEWPORT.value,validator:H.CONSTRAIN_TO_VIEWPORT.validator,supercedes:H.CONSTRAIN_TO_VIEWPORT.supercedes});this.cfg.addProperty(H.IFRAME.key,{handler:this.configIframe,value:H.IFRAME.value,validator:H.IFRAME.validator,supercedes:H.IFRAME.supercedes});},moveTo:function(K,L){this.cfg.setProperty("xy",[K,L]);},hideMacGeckoScrollbars:function(){D.removeClass(this.element,"show-scrollbars");D.addClass(this.element,"hide-scrollbars");},showMacGeckoScrollbars:function(){D.removeClass(this.element,"hide-scrollbars");D.addClass(this.element,"show-scrollbars");},configVisible:function(N,K,T){var M=K[0],O=D.getStyle(this.element,"visibility"),U=this.cfg.getProperty("effect"),R=[],Q=(this.platform=="mac"&&YAHOO.env.ua.gecko),b=C.alreadySubscribed,S,L,a,Y,X,W,Z,V,P;if(O=="inherit"){a=this.element.parentNode;while(a.nodeType!=9&&a.nodeType!=11){O=D.getStyle(a,"visibility");if(O!="inherit"){break;}a=a.parentNode;}if(O=="inherit"){O="visible";}}if(U){if(U instanceof Array){V=U.length;for(Y=0;Y<V;Y++){S=U[Y];R[R.length]=S.effect(this,S.duration);}}else{R[R.length]=U.effect(this,U.duration);}}if(M){if(Q){this.showMacGeckoScrollbars();}if(U){if(M){if(O!="visible"||O===""){this.beforeShowEvent.fire();P=R.length;for(X=0;X<P;X++){L=R[X];if(X===0&&!b(L.animateInCompleteEvent,this.showEvent.fire,this.showEvent)){L.animateInCompleteEvent.subscribe(this.showEvent.fire,this.showEvent,true);}L.animateIn();}}}}else{if(O!="visible"||O===""){this.beforeShowEvent.fire();D.setStyle(this.element,"visibility","visible");this.cfg.refireEvent("iframe");this.showEvent.fire();}}}else{if(Q){this.hideMacGeckoScrollbars();}if(U){if(O=="visible"){this.beforeHideEvent.fire();P=R.length;for(W=0;W<P;W++){Z=R[W];if(W===0&&!b(Z.animateOutCompleteEvent,this.hideEvent.fire,this.hideEvent)){Z.animateOutCompleteEvent.subscribe(this.hideEvent.fire,this.hideEvent,true);}Z.animateOut();}}else{if(O===""){D.setStyle(this.element,"visibility","hidden");}}}else{if(O=="visible"||O===""){this.beforeHideEvent.fire();D.setStyle(this.element,"visibility","hidden");this.hideEvent.fire();}}}},doCenterOnDOMEvent:function(){if(this.cfg.getProperty("visible")){this.center();}},configFixedCenter:function(O,M,P){var Q=M[0],L=C.alreadySubscribed,N=B.windowResizeEvent,K=B.windowScrollEvent;if(Q){this.center();if(!L(this.beforeShowEvent,this.center,this)){this.beforeShowEvent.subscribe(this.center);}if(!L(N,this.doCenterOnDOMEvent,this)){N.subscribe(this.doCenterOnDOMEvent,this,true);}if(!L(K,this.doCenterOnDOMEvent,this)){K.subscribe(this.doCenterOnDOMEvent,this,true);}}else{this.beforeShowEvent.unsubscribe(this.center);N.unsubscribe(this.doCenterOnDOMEvent,this);K.unsubscribe(this.doCenterOnDOMEvent,this);}},configHeight:function(N,L,O){var K=L[0],M=this.element;D.setStyle(M,"height",K);this.cfg.refireEvent("iframe");},configWidth:function(N,K,O){var M=K[0],L=this.element;D.setStyle(L,"width",M);this.cfg.refireEvent("iframe");},configzIndex:function(M,K,N){var O=K[0],L=this.element;if(!O){O=D.getStyle(L,"zIndex");if(!O||isNaN(O)){O=0;}}if(this.iframe||this.cfg.getProperty("iframe")===true){if(O<=0){O=1;}}D.setStyle(L,"zIndex",O);this.cfg.setProperty("zIndex",O,true);if(this.iframe){this.stackIframe();}},configXY:function(M,L,N){var P=L[0],K=P[0],O=P[1];this.cfg.setProperty("x",K);this.cfg.setProperty("y",O);this.beforeMoveEvent.fire([K,O]);K=this.cfg.getProperty("x");O=this.cfg.getProperty("y");this.cfg.refireEvent("iframe");this.moveEvent.fire([K,O]);},configX:function(M,L,N){var K=L[0],O=this.cfg.getProperty("y");this.cfg.setProperty("x",K,true);this.cfg.setProperty("y",O,true);this.beforeMoveEvent.fire([K,O]);K=this.cfg.getProperty("x");O=this.cfg.getProperty("y");D.setX(this.element,K,true);this.cfg.setProperty("xy",[K,O],true);this.cfg.refireEvent("iframe");this.moveEvent.fire([K,O]);},configY:function(M,L,N){var K=this.cfg.getProperty("x"),O=L[0];this.cfg.setProperty("x",K,true);this.cfg.setProperty("y",O,true);this.beforeMoveEvent.fire([K,O]);K=this.cfg.getProperty("x");O=this.cfg.getProperty("y");D.setY(this.element,O,true);this.cfg.setProperty("xy",[K,O],true);this.cfg.refireEvent("iframe");this.moveEvent.fire([K,O]);},showIframe:function(){var L=this.iframe,K;if(L){K=this.element.parentNode;if(K!=L.parentNode){this._addToParent(K,L);}L.style.display="block";}},hideIframe:function(){if(this.iframe){this.iframe.style.display="none";}},syncIframe:function(){var K=this.iframe,M=this.element,O=B.IFRAME_OFFSET,L=(O*2),N;if(K){K.style.width=(M.offsetWidth+L+"px");K.style.height=(M.offsetHeight+L+"px");N=this.cfg.getProperty("xy");if(!F.isArray(N)||(isNaN(N[0])||isNaN(N[1]))){this.syncPosition();N=this.cfg.getProperty("xy");}D.setXY(K,[(N[0]-O),(N[1]-O)]);}},stackIframe:function(){if(this.iframe){var K=D.getStyle(this.element,"zIndex");if(!YAHOO.lang.isUndefined(K)&&!isNaN(K)){D.setStyle(this.iframe,"zIndex",(K-1));}}},configIframe:function(N,M,O){var K=M[0];function P(){var R=this.iframe,S=this.element,T;if(!R){if(!G){G=document.createElement("iframe");if(this.isSecure){G.src=B.IFRAME_SRC;}if(YAHOO.env.ua.ie){G.style.filter="alpha(opacity=0)";G.frameBorder=0;}else{G.style.opacity="0";}G.style.position="absolute";G.style.border="none";G.style.margin="0";G.style.padding="0";G.style.display="none";}R=G.cloneNode(false);T=S.parentNode;var Q=T||document.body;this._addToParent(Q,R);this.iframe=R;}this.showIframe();this.syncIframe();this.stackIframe();if(!this._hasIframeEventListeners){this.showEvent.subscribe(this.showIframe);this.hideEvent.subscribe(this.hideIframe);this.changeContentEvent.subscribe(this.syncIframe);this._hasIframeEventListeners=true;}}function L(){P.call(this);this.beforeShowEvent.unsubscribe(L);this._iframeDeferred=false;}if(K){if(this.cfg.getProperty("visible")){P.call(this);}else{if(!this._iframeDeferred){this.beforeShowEvent.subscribe(L);this._iframeDeferred=true;}}}else{this.hideIframe();if(this._hasIframeEventListeners){this.showEvent.unsubscribe(this.showIframe);this.hideEvent.unsubscribe(this.hideIframe);this.changeContentEvent.unsubscribe(this.syncIframe);this._hasIframeEventListeners=false;}}},_primeXYFromDOM:function(){if(YAHOO.lang.isUndefined(this.cfg.getProperty("xy"))){this.syncPosition();this.cfg.refireEvent("xy");this.beforeShowEvent.unsubscribe(this._primeXYFromDOM);}},configConstrainToViewport:function(L,K,M){var N=K[0];if(N){if(!C.alreadySubscribed(this.beforeMoveEvent,this.enforceConstraints,this)){this.beforeMoveEvent.subscribe(this.enforceConstraints,this,true);}if(!C.alreadySubscribed(this.beforeShowEvent,this._primeXYFromDOM)){this.beforeShowEvent.subscribe(this._primeXYFromDOM);}}else{this.beforeShowEvent.unsubscribe(this._primeXYFromDOM);this.beforeMoveEvent.unsubscribe(this.enforceConstraints,this);}},configContext:function(M,L,O){var Q=L[0],N,P,K;if(Q){N=Q[0];P=Q[1];K=Q[2];if(N){if(typeof N=="string"){this.cfg.setProperty("context",[document.getElementById(N),P,K],true);}if(P&&K){this.align(P,K);}}}},align:function(L,K){var Q=this.cfg.getProperty("context"),P=this,O,N,R;function M(S,T){switch(L){case B.TOP_LEFT:P.moveTo(T,S);break;case B.TOP_RIGHT:P.moveTo((T-N.offsetWidth),S);break;case B.BOTTOM_LEFT:P.moveTo(T,(S-N.offsetHeight));break;case B.BOTTOM_RIGHT:P.moveTo((T-N.offsetWidth),(S-N.offsetHeight));break;}}if(Q){O=Q[0];N=this.element;P=this;if(!L){L=Q[1];}if(!K){K=Q[2];}if(N&&O){R=D.getRegion(O);switch(K){case B.TOP_LEFT:M(R.top,R.left);break;case B.TOP_RIGHT:M(R.top,R.right);break;case B.BOTTOM_LEFT:M(R.bottom,R.left);break;case B.BOTTOM_RIGHT:M(R.bottom,R.right);break;}}}},enforceConstraints:function(L,K,M){var O=K[0];var N=this.getConstrainedXY(O[0],O[1]);this.cfg.setProperty("x",N[0],true);this.cfg.setProperty("y",N[1],true);this.cfg.setProperty("xy",N,true);},getConstrainedXY:function(V,T){var N=B.VIEWPORT_OFFSET,U=D.getViewportWidth(),Q=D.getViewportHeight(),M=this.element.offsetHeight,S=this.element.offsetWidth,Y=D.getDocumentScrollLeft(),W=D.getDocumentScrollTop();var P=V;var L=T;if(S+N<U){var R=Y+N;var X=Y+U-S-N;if(V<R){P=R;}else{if(V>X){P=X;}}}else{P=N+Y;}if(M+N<Q){var O=W+N;var K=W+Q-M-N;if(T<O){L=O;}else{if(T>K){L=K;}}}else{L=N+W;}return[P,L];},center:function(){var N=B.VIEWPORT_OFFSET,O=this.element.offsetWidth,M=this.element.offsetHeight,L=D.getViewportWidth(),P=D.getViewportHeight(),K,Q;if(O<L){K=(L/2)-(O/2)+D.getDocumentScrollLeft();}else{K=N+D.getDocumentScrollLeft();}if(M<P){Q=(P/2)-(M/2)+D.getDocumentScrollTop();}else{Q=N+D.getDocumentScrollTop();}this.cfg.setProperty("xy",[parseInt(K,10),parseInt(Q,10)]);this.cfg.refireEvent("iframe");},syncPosition:function(){var K=D.getXY(this.element);this.cfg.setProperty("x",K[0],true);this.cfg.setProperty("y",K[1],true);this.cfg.setProperty("xy",K,true);},onDomResize:function(M,L){var K=this;B.superclass.onDomResize.call(this,M,L);setTimeout(function(){K.syncPosition();K.cfg.refireEvent("iframe");K.cfg.refireEvent("context");},0);},bringToTop:function(){var O=[],N=this.element;function R(V,U){var X=D.getStyle(V,"zIndex"),W=D.getStyle(U,"zIndex"),T=(!X||isNaN(X))?0:parseInt(X,10),S=(!W||isNaN(W))?0:parseInt(W,10);if(T>S){return-1;}else{if(T<S){return 1;}else{return 0;}}}function M(U){var S=D.hasClass(U,B.CSS_OVERLAY),T=YAHOO.widget.Panel;if(S&&!D.isAncestor(N,S)){if(T&&D.hasClass(U,T.CSS_PANEL)){O[O.length]=U.parentNode;}else{O[O.length]=U;}}}D.getElementsBy(M,"DIV",document.body);O.sort(R);var K=O[0],Q;if(K){Q=D.getStyle(K,"zIndex");if(!isNaN(Q)){var P=false;if(K!=N){P=true;}else{if(O.length>1){var L=D.getStyle(O[1],"zIndex");if(!isNaN(L)&&(Q==L)){P=true;}}}if(P){this.cfg.setProperty("zindex",(parseInt(Q,10)+2));}}}},destroy:function(){if(this.iframe){this.iframe.parentNode.removeChild(this.iframe);}this.iframe=null;B.windowResizeEvent.unsubscribe(this.doCenterOnDOMEvent,this);B.windowScrollEvent.unsubscribe(this.doCenterOnDOMEvent,this);B.superclass.destroy.call(this);},toString:function(){return"Overlay "+this.id;}});}());(function(){YAHOO.widget.OverlayManager=function(G){this.init(G);};var D=YAHOO.widget.Overlay,C=YAHOO.util.Event,E=YAHOO.util.Dom,B=YAHOO.util.Config,F=YAHOO.util.CustomEvent,A=YAHOO.widget.OverlayManager;A.CSS_FOCUSED="focused";A.prototype={constructor:A,overlays:null,initDefaultConfig:function(){this.cfg.addProperty("overlays",{suppressEvent:true});this.cfg.addProperty("focusevent",{value:"mousedown"});},init:function(I){this.cfg=new B(this);this.initDefaultConfig();if(I){this.cfg.applyConfig(I,true);}this.cfg.fireQueue();var H=null;this.getActive=function(){return H;};this.focus=function(J){var K=this.find(J);if(K){if(H!=K){if(H){H.blur();}this.bringToTop(K);H=K;E.addClass(H.element,A.CSS_FOCUSED);K.focusEvent.fire();}}};this.remove=function(K){var M=this.find(K),J;if(M){if(H==M){H=null;}var L=(M.element===null&&M.cfg===null)?true:false;if(!L){J=E.getStyle(M.element,"zIndex");M.cfg.setProperty("zIndex",-1000,true);}this.overlays.sort(this.compareZIndexDesc);this.overlays=this.overlays.slice(0,(this.overlays.length-1));M.hideEvent.unsubscribe(M.blur);M.destroyEvent.unsubscribe(this._onOverlayDestroy,M);if(!L){C.removeListener(M.element,this.cfg.getProperty("focusevent"),this._onOverlayElementFocus);M.cfg.setProperty("zIndex",J,true);M.cfg.setProperty("manager",null);}M.focusEvent.unsubscribeAll();M.blurEvent.unsubscribeAll();M.focusEvent=null;M.blurEvent=null;M.focus=null;M.blur=null;}};this.blurAll=function(){var K=this.overlays.length,J;if(K>0){J=K-1;do{this.overlays[J].blur();}while(J--);}};this._onOverlayBlur=function(K,J){H=null;};var G=this.cfg.getProperty("overlays");if(!this.overlays){this.overlays=[];}if(G){this.register(G);this.overlays.sort(this.compareZIndexDesc);}},_onOverlayElementFocus:function(I){var G=C.getTarget(I),H=this.close;if(H&&(G==H||E.isAncestor(H,G))){this.blur();}else{this.focus();}},_onOverlayDestroy:function(H,G,I){this.remove(I);},register:function(G){var K=this,L,I,H,J;if(G instanceof D){G.cfg.addProperty("manager",{value:this});G.focusEvent=G.createEvent("focus");G.focusEvent.signature=F.LIST;G.blurEvent=G.createEvent("blur");G.blurEvent.signature=F.LIST;G.focus=function(){K.focus(this);};G.blur=function(){if(K.getActive()==this){E.removeClass(this.element,A.CSS_FOCUSED);this.blurEvent.fire();}};G.blurEvent.subscribe(K._onOverlayBlur);G.hideEvent.subscribe(G.blur);G.destroyEvent.subscribe(this._onOverlayDestroy,G,this);C.on(G.element,this.cfg.getProperty("focusevent"),this._onOverlayElementFocus,null,G);L=E.getStyle(G.element,"zIndex");if(!isNaN(L)){G.cfg.setProperty("zIndex",parseInt(L,10));}else{G.cfg.setProperty("zIndex",0);}this.overlays.push(G);this.bringToTop(G);return true;}else{if(G instanceof Array){I=0;J=G.length;for(H=0;H<J;H++){if(this.register(G[H])){I++;}}if(I>0){return true;}}else{return false;}}},bringToTop:function(M){var I=this.find(M),L,G,J;if(I){J=this.overlays;J.sort(this.compareZIndexDesc);G=J[0];if(G){L=E.getStyle(G.element,"zIndex");if(!isNaN(L)){var K=false;if(G!==I){K=true;}else{if(J.length>1){var H=E.getStyle(J[1].element,"zIndex");if(!isNaN(H)&&(L==H)){K=true;}}}if(K){I.cfg.setProperty("zindex",(parseInt(L,10)+2));}}J.sort(this.compareZIndexDesc);}}},find:function(G){var I=this.overlays,J=I.length,H;if(J>0){H=J-1;if(G instanceof D){do{if(I[H]==G){return I[H];}}while(H--);}else{if(typeof G=="string"){do{if(I[H].id==G){return I[H];}}while(H--);}}return null;}},compareZIndexDesc:function(J,I){var H=(J.cfg)?J.cfg.getProperty("zIndex"):null,G=(I.cfg)?I.cfg.getProperty("zIndex"):null;if(H===null&&G===null){return 0;}else{if(H===null){return 1;}else{if(G===null){return-1;}else{if(H>G){return-1;}else{if(H<G){return 1;}else{return 0;}}}}}},showAll:function(){var H=this.overlays,I=H.length,G;if(I>0){G=I-1;do{H[G].show();}while(G--);}},hideAll:function(){var H=this.overlays,I=H.length,G;if(I>0){G=I-1;do{H[G].hide();}while(G--);}},toString:function(){return"OverlayManager";}};}());(function(){YAHOO.widget.Tooltip=function(N,M){YAHOO.widget.Tooltip.superclass.constructor.call(this,N,M);};var E=YAHOO.lang,L=YAHOO.util.Event,K=YAHOO.util.CustomEvent,C=YAHOO.util.Dom,G=YAHOO.widget.Tooltip,F,H={"PREVENT_OVERLAP":{key:"preventoverlap",value:true,validator:E.isBoolean,supercedes:["x","y","xy"]},"SHOW_DELAY":{key:"showdelay",value:200,validator:E.isNumber},"AUTO_DISMISS_DELAY":{key:"autodismissdelay",value:5000,validator:E.isNumber},"HIDE_DELAY":{key:"hidedelay",value:250,validator:E.isNumber},"TEXT":{key:"text",suppressEvent:true},"CONTAINER":{key:"container"},"DISABLED":{key:"disabled",value:false,suppressEvent:true}},A={"CONTEXT_MOUSE_OVER":"contextMouseOver","CONTEXT_MOUSE_OUT":"contextMouseOut","CONTEXT_TRIGGER":"contextTrigger"};G.CSS_TOOLTIP="yui-tt";function I(N,M,O){var R=O[0],P=O[1],Q=this.cfg,S=Q.getProperty("width");if(S==P){Q.setProperty("width",R);}this.unsubscribe("hide",this._onHide,O);}function D(N,M){var O=document.body,S=this.cfg,R=S.getProperty("width"),P,Q;if((!R||R=="auto")&&(S.getProperty("container")!=O||S.getProperty("x")>=C.getViewportWidth()||S.getProperty("y")>=C.getViewportHeight())){Q=this.element.cloneNode(true);Q.style.visibility="hidden";Q.style.top="0px";Q.style.left="0px";O.appendChild(Q);P=(Q.offsetWidth+"px");O.removeChild(Q);Q=null;S.setProperty("width",P);S.refireEvent("xy");this.subscribe("hide",I,[(R||""),P]);}}function B(N,M,O){this.render(O);}function J(){L.onDOMReady(B,this.cfg.getProperty("container"),this);}YAHOO.extend(G,YAHOO.widget.Overlay,{init:function(N,M){G.superclass.init.call(this,N);this.beforeInitEvent.fire(G);C.addClass(this.element,G.CSS_TOOLTIP);if(M){this.cfg.applyConfig(M,true);}this.cfg.queueProperty("visible",false);this.cfg.queueProperty("constraintoviewport",true);this.setBody("");this.subscribe("beforeShow",D);this.subscribe("init",J);this.subscribe("render",this.onRender);this.initEvent.fire(G);},initEvents:function(){G.superclass.initEvents.call(this);var M=K.LIST;this.contextMouseOverEvent=this.createEvent(A.CONTEXT_MOUSE_OVER);this.contextMouseOverEvent.signature=M;this.contextMouseOutEvent=this.createEvent(A.CONTEXT_MOUSE_OUT);this.contextMouseOutEvent.signature=M;this.contextTriggerEvent=this.createEvent(A.CONTEXT_TRIGGER);this.contextTriggerEvent.signature=M;},initDefaultConfig:function(){G.superclass.initDefaultConfig.call(this);this.cfg.addProperty(H.PREVENT_OVERLAP.key,{value:H.PREVENT_OVERLAP.value,validator:H.PREVENT_OVERLAP.validator,supercedes:H.PREVENT_OVERLAP.supercedes});this.cfg.addProperty(H.SHOW_DELAY.key,{handler:this.configShowDelay,value:200,validator:H.SHOW_DELAY.validator});this.cfg.addProperty(H.AUTO_DISMISS_DELAY.key,{handler:this.configAutoDismissDelay,value:H.AUTO_DISMISS_DELAY.value,validator:H.AUTO_DISMISS_DELAY.validator});this.cfg.addProperty(H.HIDE_DELAY.key,{handler:this.configHideDelay,value:H.HIDE_DELAY.value,validator:H.HIDE_DELAY.validator});this.cfg.addProperty(H.TEXT.key,{handler:this.configText,suppressEvent:H.TEXT.suppressEvent});this.cfg.addProperty(H.CONTAINER.key,{handler:this.configContainer,value:document.body});this.cfg.addProperty(H.DISABLED.key,{handler:this.configContainer,value:H.DISABLED.value,supressEvent:H.DISABLED.suppressEvent});},configText:function(N,M,O){var P=M[0];if(P){this.setBody(P);}},configContainer:function(O,N,P){var M=N[0];if(typeof M=="string"){this.cfg.setProperty("container",document.getElementById(M),true);}},_removeEventListeners:function(){var P=this._context,M,O,N;if(P){M=P.length;if(M>0){N=M-1;do{O=P[N];L.removeListener(O,"mouseover",this.onContextMouseOver);L.removeListener(O,"mousemove",this.onContextMouseMove);L.removeListener(O,"mouseout",this.onContextMouseOut);}while(N--);}}},configContext:function(R,N,S){var Q=N[0],T,M,P,O;if(Q){if(!(Q instanceof Array)){if(typeof Q=="string"){this.cfg.setProperty("context",[document.getElementById(Q)],true);}else{this.cfg.setProperty("context",[Q],true);}Q=this.cfg.getProperty("context");}this._removeEventListeners();this._context=Q;T=this._context;if(T){M=T.length;if(M>0){O=M-1;do{P=T[O];L.on(P,"mouseover",this.onContextMouseOver,this);L.on(P,"mousemove",this.onContextMouseMove,this);L.on(P,"mouseout",this.onContextMouseOut,this);}while(O--);}}}},onContextMouseMove:function(N,M){M.pageX=L.getPageX(N);M.pageY=L.getPageY(N);},onContextMouseOver:function(O,N){var M=this;if(M.title){N._tempTitle=M.title;M.title="";}if(N.fireEvent("contextMouseOver",M,O)!==false&&!N.cfg.getProperty("disabled")){if(N.hideProcId){clearTimeout(N.hideProcId);N.hideProcId=null;}L.on(M,"mousemove",N.onContextMouseMove,N);N.showProcId=N.doShow(O,M);}},onContextMouseOut:function(O,N){var M=this;if(N._tempTitle){M.title=N._tempTitle;N._tempTitle=null;}if(N.showProcId){clearTimeout(N.showProcId);N.showProcId=null;}if(N.hideProcId){clearTimeout(N.hideProcId);N.hideProcId=null;}N.fireEvent("contextMouseOut",M,O);N.hideProcId=setTimeout(function(){N.hide();},N.cfg.getProperty("hidedelay"));},doShow:function(O,M){var P=25,N=this;if(YAHOO.env.ua.opera&&M.tagName&&M.tagName.toUpperCase()=="A"){P+=12;}return setTimeout(function(){var Q=N.cfg.getProperty("text");if(N._tempTitle&&(Q===""||YAHOO.lang.isUndefined(Q)||YAHOO.lang.isNull(Q))){N.setBody(N._tempTitle);}else{N.cfg.refireEvent("text");}N.moveTo(N.pageX,N.pageY+P);if(N.cfg.getProperty("preventoverlap")){N.preventOverlap(N.pageX,N.pageY);}L.removeListener(M,"mousemove",N.onContextMouseMove);N.contextTriggerEvent.fire(M);N.show();N.hideProcId=N.doHide();},this.cfg.getProperty("showdelay"));},doHide:function(){var M=this;return setTimeout(function(){M.hide();},this.cfg.getProperty("autodismissdelay"));},preventOverlap:function(Q,P){var M=this.element.offsetHeight,O=new YAHOO.util.Point(Q,P),N=C.getRegion(this.element);N.top-=5;N.left-=5;N.right+=5;N.bottom+=5;if(N.contains(O)){this.cfg.setProperty("y",(P-M-5));}},onRender:function(Q,P){function R(){var U=this.element,T=this._shadow;if(T){T.style.width=(U.offsetWidth+6)+"px";T.style.height=(U.offsetHeight+1)+"px";}}function N(){C.addClass(this._shadow,"yui-tt-shadow-visible");}function M(){C.removeClass(this._shadow,"yui-tt-shadow-visible");}function S(){var V=this._shadow,U,T,X,W;if(!V){U=this.element;T=YAHOO.widget.Module;X=YAHOO.env.ua.ie;W=this;if(!F){F=document.createElement("div");F.className="yui-tt-shadow";}V=F.cloneNode(false);U.appendChild(V);this._shadow=V;N.call(this);this.subscribe("beforeShow",N);this.subscribe("beforeHide",M);if(X==6||(X==7&&document.compatMode=="BackCompat")){window.setTimeout(function(){R.call(W);},0);this.cfg.subscribeToConfigEvent("width",R);this.cfg.subscribeToConfigEvent("height",R);this.subscribe("changeContent",R);T.textResizeEvent.subscribe(R,this,true);this.subscribe("destroy",function(){T.textResizeEvent.unsubscribe(R,this);});}}}function O(){S.call(this);this.unsubscribe("beforeShow",O);}if(this.cfg.getProperty("visible")){S.call(this);}else{this.subscribe("beforeShow",O);}},destroy:function(){this._removeEventListeners();G.superclass.destroy.call(this);},toString:function(){return"Tooltip "+this.id;}});}());(function(){YAHOO.widget.Panel=function(R,Q){YAHOO.widget.Panel.superclass.constructor.call(this,R,Q);};var I=YAHOO.lang,E=YAHOO.util.DD,F=YAHOO.util.Dom,P=YAHOO.util.Event,B=YAHOO.widget.Overlay,O=YAHOO.util.CustomEvent,C=YAHOO.util.Config,N=YAHOO.widget.Panel,H,L,D,A={"SHOW_MASK":"showMask","HIDE_MASK":"hideMask","DRAG":"drag"},J={"CLOSE":{key:"close",value:true,validator:I.isBoolean,supercedes:["visible"]},"DRAGGABLE":{key:"draggable",value:(E?true:false),validator:I.isBoolean,supercedes:["visible"]},"DRAG_ONLY":{key:"dragonly",value:false,validator:I.isBoolean,supercedes:["draggable"]},"UNDERLAY":{key:"underlay",value:"shadow",supercedes:["visible"]},"MODAL":{key:"modal",value:false,validator:I.isBoolean,supercedes:["visible","zindex"]},"KEY_LISTENERS":{key:"keylisteners",suppressEvent:true,supercedes:["visible"]}};N.CSS_PANEL="yui-panel";N.CSS_PANEL_CONTAINER="yui-panel-container";N.FOCUSABLE=["a","button","select","textarea","input"];function M(R,Q){if(!this.header&&this.cfg.getProperty("draggable")){this.setHeader("&#160;");}}function K(R,Q,S){var V=S[0],T=S[1],U=this.cfg,W=U.getProperty("width");if(W==T){U.setProperty("width",V);}this.unsubscribe("hide",K,S);}function G(R,Q){var V=YAHOO.env.ua.ie,U,T,S;if(V==6||(V==7&&document.compatMode=="BackCompat")){U=this.cfg;T=U.getProperty("width");if(!T||T=="auto"){S=(this.element.offsetWidth+"px");U.setProperty("width",S);this.subscribe("hide",K,[(T||""),S]);}}}YAHOO.extend(N,B,{init:function(R,Q){N.superclass.init.call(this,R);this.beforeInitEvent.fire(N);F.addClass(this.element,N.CSS_PANEL);this.buildWrapper();if(Q){this.cfg.applyConfig(Q,true);}this.subscribe("showMask",this._addFocusHandlers);this.subscribe("hideMask",this._removeFocusHandlers);this.subscribe("beforeRender",M);this.initEvent.fire(N);},_onElementFocus:function(Q){this.blur();},_addFocusHandlers:function(Y,S){var V=this,Z="focus",U="hidden";function X(a){if(a.type!==U&&!F.isAncestor(V.element,a)){P.on(a,Z,V._onElementFocus);return true;}return false;}var W=N.FOCUSABLE,Q=W.length,T=[];for(var R=0;R<Q;R++){T=T.concat(F.getElementsBy(X,W[R]));}this.focusableElements=T;},_removeFocusHandlers:function(T,S){var V=this.focusableElements,Q=V.length,R="focus";if(V){for(var U=0;U<Q;U++){P.removeListener(V[U],R,this._onElementFocus);}}},initEvents:function(){N.superclass.initEvents.call(this);var Q=O.LIST;this.showMaskEvent=this.createEvent(A.SHOW_MASK);this.showMaskEvent.signature=Q;this.hideMaskEvent=this.createEvent(A.HIDE_MASK);this.hideMaskEvent.signature=Q;this.dragEvent=this.createEvent(A.DRAG);this.dragEvent.signature=Q;},initDefaultConfig:function(){N.superclass.initDefaultConfig.call(this);this.cfg.addProperty(J.CLOSE.key,{handler:this.configClose,value:J.CLOSE.value,validator:J.CLOSE.validator,supercedes:J.CLOSE.supercedes});this.cfg.addProperty(J.DRAGGABLE.key,{handler:this.configDraggable,value:J.DRAGGABLE.value,validator:J.DRAGGABLE.validator,supercedes:J.DRAGGABLE.supercedes});this.cfg.addProperty(J.DRAG_ONLY.key,{value:J.DRAG_ONLY.value,validator:J.DRAG_ONLY.validator,supercedes:J.DRAG_ONLY.supercedes});this.cfg.addProperty(J.UNDERLAY.key,{handler:this.configUnderlay,value:J.UNDERLAY.value,supercedes:J.UNDERLAY.supercedes});this.cfg.addProperty(J.MODAL.key,{handler:this.configModal,value:J.MODAL.value,validator:J.MODAL.validator,supercedes:J.MODAL.supercedes});this.cfg.addProperty(J.KEY_LISTENERS.key,{handler:this.configKeyListeners,suppressEvent:J.KEY_LISTENERS.suppressEvent,supercedes:J.KEY_LISTENERS.supercedes});},configClose:function(S,Q,U){var V=Q[0],R=this.close;function T(X,W){W.hide();}if(V){if(!R){if(!D){D=document.createElement("span");D.innerHTML="&#160;";D.className="container-close";}R=D.cloneNode(true);this.innerElement.appendChild(R);P.on(R,"click",T,this);this.close=R;}else{R.style.display="block";}}else{if(R){R.style.display="none";}}},configDraggable:function(R,Q,S){var T=Q[0];if(T){if(!E){this.cfg.setProperty("draggable",false);return;}if(this.header){F.setStyle(this.header,"cursor","move");this.registerDragDrop();}this.subscribe("beforeShow",G);}else{if(this.dd){this.dd.unreg();}if(this.header){F.setStyle(this.header,"cursor","auto");}this.unsubscribe("beforeShow",G);}},configUnderlay:function(b,a,V){var Z=YAHOO.env.ua,X=(this.platform=="mac"&&Z.gecko),Y=(Z.ie==6||(Z.ie==7&&document.compatMode=="BackCompat")),c=a[0].toLowerCase(),R=this.underlay,S=this.element;function d(){var e=this.underlay;F.addClass(e,"yui-force-redraw");window.setTimeout(function(){F.removeClass(e,"yui-force-redraw");},0);}function T(){var e=false;if(!R){if(!L){L=document.createElement("div");L.className="underlay";}R=L.cloneNode(false);this.element.appendChild(R);this.underlay=R;if(Y){this.sizeUnderlay();this.cfg.subscribeToConfigEvent("width",this.sizeUnderlay);this.cfg.subscribeToConfigEvent("height",this.sizeUnderlay);this.changeContentEvent.subscribe(this.sizeUnderlay);YAHOO.widget.Module.textResizeEvent.subscribe(this.sizeUnderlay,this,true);}if(Z.webkit&&Z.webkit<420){this.changeContentEvent.subscribe(d);}e=true;}}function W(){var e=T.call(this);if(!e&&Y){this.sizeUnderlay();}this._underlayDeferred=false;this.beforeShowEvent.unsubscribe(W);}function U(){if(this._underlayDeferred){this.beforeShowEvent.unsubscribe(W);this._underlayDeferred=false;}if(R){this.cfg.unsubscribeFromConfigEvent("width",this.sizeUnderlay);this.cfg.unsubscribeFromConfigEvent("height",this.sizeUnderlay);this.changeContentEvent.unsubscribe(this.sizeUnderlay);this.changeContentEvent.unsubscribe(d);YAHOO.widget.Module.textResizeEvent.unsubscribe(this.sizeUnderlay,this,true);this.element.removeChild(R);this.underlay=null;}}switch(c){case"shadow":F.removeClass(S,"matte");F.addClass(S,"shadow");break;case"matte":if(!X){U.call(this);}F.removeClass(S,"shadow");F.addClass(S,"matte");break;default:if(!X){U.call(this);}F.removeClass(S,"shadow");F.removeClass(S,"matte");break;}if((c=="shadow")||(X&&!R)){if(this.cfg.getProperty("visible")){var Q=T.call(this);if(!Q&&Y){this.sizeUnderlay();}}else{if(!this._underlayDeferred){this.beforeShowEvent.subscribe(W);this._underlayDeferred=true;}}}},configModal:function(R,Q,T){var S=Q[0];if(S){if(!this._hasModalityEventListeners){this.subscribe("beforeShow",this.buildMask);this.subscribe("beforeShow",this.bringToTop);this.subscribe("beforeShow",this.showMask);this.subscribe("hide",this.hideMask);B.windowResizeEvent.subscribe(this.sizeMask,this,true);this._hasModalityEventListeners=true;}}else{if(this._hasModalityEventListeners){if(this.cfg.getProperty("visible")){this.hideMask();this.removeMask();}this.unsubscribe("beforeShow",this.buildMask);this.unsubscribe("beforeShow",this.bringToTop);this.unsubscribe("beforeShow",this.showMask);this.unsubscribe("hide",this.hideMask);B.windowResizeEvent.unsubscribe(this.sizeMask,this);this._hasModalityEventListeners=false;}}},removeMask:function(){var R=this.mask,Q;if(R){this.hideMask();Q=R.parentNode;if(Q){Q.removeChild(R);}this.mask=null;}},configKeyListeners:function(T,Q,W){var S=Q[0],V,U,R;if(S){if(S instanceof Array){U=S.length;for(R=0;R<U;R++){V=S[R];if(!C.alreadySubscribed(this.showEvent,V.enable,V)){this.showEvent.subscribe(V.enable,V,true);}if(!C.alreadySubscribed(this.hideEvent,V.disable,V)){this.hideEvent.subscribe(V.disable,V,true);this.destroyEvent.subscribe(V.disable,V,true);}}}else{if(!C.alreadySubscribed(this.showEvent,S.enable,S)){this.showEvent.subscribe(S.enable,S,true);}if(!C.alreadySubscribed(this.hideEvent,S.disable,S)){this.hideEvent.subscribe(S.disable,S,true);this.destroyEvent.subscribe(S.disable,S,true);}}}},configHeight:function(T,R,U){var Q=R[0],S=this.innerElement;F.setStyle(S,"height",Q);this.cfg.refireEvent("iframe");},configWidth:function(T,Q,U){var S=Q[0],R=this.innerElement;F.setStyle(R,"width",S);this.cfg.refireEvent("iframe");},configzIndex:function(R,Q,T){N.superclass.configzIndex.call(this,R,Q,T);if(this.mask||this.cfg.getProperty("modal")===true){var S=F.getStyle(this.element,"zIndex");if(!S||isNaN(S)){S=0;}if(S===0){this.cfg.setProperty("zIndex",1);}else{this.stackMask();}}},buildWrapper:function(){var S=this.element.parentNode,Q=this.element,R=document.createElement("div");R.className=N.CSS_PANEL_CONTAINER;R.id=Q.id+"_c";if(S){S.insertBefore(R,Q);}R.appendChild(Q);this.element=R;this.innerElement=Q;F.setStyle(this.innerElement,"visibility","inherit");},sizeUnderlay:function(){var R=this.underlay,Q;if(R){Q=this.element;R.style.width=Q.offsetWidth+"px";R.style.height=Q.offsetHeight+"px";}},registerDragDrop:function(){var R=this;if(this.header){if(!E){return;}var Q=(this.cfg.getProperty("dragonly")===true);this.dd=new E(this.element.id,this.id,{dragOnly:Q});if(!this.header.id){this.header.id=this.id+"_h";}this.dd.startDrag=function(){var T,V,S,Y,X,W;if(YAHOO.env.ua.ie==6){F.addClass(R.element,"drag");}if(R.cfg.getProperty("constraintoviewport")){var U=B.VIEWPORT_OFFSET;T=R.element.offsetHeight;V=R.element.offsetWidth;S=F.getViewportWidth();Y=F.getViewportHeight();X=F.getDocumentScrollLeft();W=F.getDocumentScrollTop();if(T+U<Y){this.minY=W+U;this.maxY=W+Y-T-U;}else{this.minY=W+U;this.maxY=W+U;}if(V+U<S){this.minX=X+U;this.maxX=X+S-V-U;}else{this.minX=X+U;this.maxX=X+U;}this.constrainX=true;this.constrainY=true;}else{this.constrainX=false;this.constrainY=false;}R.dragEvent.fire("startDrag",arguments);};this.dd.onDrag=function(){R.syncPosition();R.cfg.refireEvent("iframe");if(this.platform=="mac"&&YAHOO.env.ua.gecko){this.showMacGeckoScrollbars();}R.dragEvent.fire("onDrag",arguments);};this.dd.endDrag=function(){if(YAHOO.env.ua.ie==6){F.removeClass(R.element,"drag");}R.dragEvent.fire("endDrag",arguments);R.moveEvent.fire(R.cfg.getProperty("xy"));};this.dd.setHandleElId(this.header.id);this.dd.addInvalidHandleType("INPUT");this.dd.addInvalidHandleType("SELECT");this.dd.addInvalidHandleType("TEXTAREA");}},buildMask:function(){var Q=this.mask;if(!Q){if(!H){H=document.createElement("div");H.className="mask";H.innerHTML="&#160;";}Q=H.cloneNode(true);Q.id=this.id+"_mask";document.body.insertBefore(Q,document.body.firstChild);this.mask=Q;if(YAHOO.env.ua.gecko&&this.platform=="mac"){F.addClass(this.mask,"block-scrollbars");}this.stackMask();}},hideMask:function(){if(this.cfg.getProperty("modal")&&this.mask){this.mask.style.display="none";this.hideMaskEvent.fire();F.removeClass(document.body,"masked");}},showMask:function(){if(this.cfg.getProperty("modal")&&this.mask){F.addClass(document.body,"masked");this.sizeMask();this.mask.style.display="block";this.showMaskEvent.fire();}},sizeMask:function(){if(this.mask){this.mask.style.height=F.getDocumentHeight()+"px";this.mask.style.width=F.getDocumentWidth()+"px";}},stackMask:function(){if(this.mask){var Q=F.getStyle(this.element,"zIndex");if(!YAHOO.lang.isUndefined(Q)&&!isNaN(Q)){F.setStyle(this.mask,"zIndex",Q-1);}}},render:function(Q){return N.superclass.render.call(this,Q,this.innerElement);},destroy:function(){B.windowResizeEvent.unsubscribe(this.sizeMask,this);this.removeMask();if(this.close){P.purgeElement(this.close);}N.superclass.destroy.call(this);},toString:function(){return"Panel "+this.id;}});}());(function(){YAHOO.widget.Dialog=function(L,K){YAHOO.widget.Dialog.superclass.constructor.call(this,L,K);};var J=YAHOO.util.Event,I=YAHOO.util.CustomEvent,D=YAHOO.util.Dom,B=YAHOO.util.KeyListener,H=YAHOO.util.Connect,F=YAHOO.widget.Dialog,E=YAHOO.lang,A={"BEFORE_SUBMIT":"beforeSubmit","SUBMIT":"submit","MANUAL_SUBMIT":"manualSubmit","ASYNC_SUBMIT":"asyncSubmit","FORM_SUBMIT":"formSubmit","CANCEL":"cancel"},G={"POST_METHOD":{key:"postmethod",value:"async"},"BUTTONS":{key:"buttons",value:"none"},"HIDEAFTERSUBMIT":{key:"hideaftersubmit",value:true}};F.CSS_DIALOG="yui-dialog";function C(){var N=this._aButtons,L,M,K;if(E.isArray(N)){L=N.length;if(L>0){K=L-1;do{M=N[K];if(YAHOO.widget.Button&&M instanceof YAHOO.widget.Button){M.destroy();}else{if(M.tagName.toUpperCase()=="BUTTON"){J.purgeElement(M);J.purgeElement(M,false);}}}while(K--);}}}YAHOO.extend(F,YAHOO.widget.Panel,{form:null,initDefaultConfig:function(){F.superclass.initDefaultConfig.call(this);this.callback={success:null,failure:null,argument:null};this.cfg.addProperty(G.POST_METHOD.key,{handler:this.configPostMethod,value:G.POST_METHOD.value,validator:function(K){if(K!="form"&&K!="async"&&K!="none"&&K!="manual"){return false;}else{return true;}}});this.cfg.addProperty(G.HIDEAFTERSUBMIT.key,{value:G.HIDEAFTERSUBMIT.value});this.cfg.addProperty(G.BUTTONS.key,{handler:this.configButtons,value:G.BUTTONS.value});},initEvents:function(){F.superclass.initEvents.call(this);var K=I.LIST;this.beforeSubmitEvent=this.createEvent(A.BEFORE_SUBMIT);this.beforeSubmitEvent.signature=K;this.submitEvent=this.createEvent(A.SUBMIT);this.submitEvent.signature=K;this.manualSubmitEvent=this.createEvent(A.MANUAL_SUBMIT);this.manualSubmitEvent.signature=K;this.asyncSubmitEvent=this.createEvent(A.ASYNC_SUBMIT);this.asyncSubmitEvent.signature=K;this.formSubmitEvent=this.createEvent(A.FORM_SUBMIT);this.formSubmitEvent.signature=K;this.cancelEvent=this.createEvent(A.CANCEL);this.cancelEvent.signature=K;},init:function(L,K){F.superclass.init.call(this,L);this.beforeInitEvent.fire(F);D.addClass(this.element,F.CSS_DIALOG);this.cfg.setProperty("visible",false);if(K){this.cfg.applyConfig(K,true);}this.showEvent.subscribe(this.focusFirst,this,true);this.beforeHideEvent.subscribe(this.blurButtons,this,true);this.subscribe("changeBody",this.registerForm);this.initEvent.fire(F);},doSubmit:function(){var Q=this.form,O=false,N=false,P,K,M,L;switch(this.cfg.getProperty("postmethod")){case"async":P=Q.elements;K=P.length;if(K>0){M=K-1;do{if(P[M].type=="file"){O=true;break;}}while(M--);}if(O&&YAHOO.env.ua.ie&&this.isSecure){N=true;}L=(Q.getAttribute("method")||"POST").toUpperCase();H.setForm(Q,O,N);H.asyncRequest(L,Q.getAttribute("action"),this.callback);this.asyncSubmitEvent.fire();break;case"form":Q.submit();this.formSubmitEvent.fire();break;case"none":case"manual":this.manualSubmitEvent.fire();break;}},registerForm:function(){var M=this.element.getElementsByTagName("form")[0],L=this,K,N;if(this.form){if(this.form==M&&D.isAncestor(this.element,this.form)){return;}else{J.purgeElement(this.form);this.form=null;}}if(!M){M=document.createElement("form");M.name="frm_"+this.id;this.body.appendChild(M);}if(M){this.form=M;J.on(M,"submit",function(O){J.stopEvent(O);this.submit();this.form.blur();},this,true);this.firstFormElement=function(){var Q,P,O=M.elements.length;for(Q=0;Q<O;Q++){P=M.elements[Q];if(P.focus&&!P.disabled&&P.type!="hidden"){return P;}}return null;}();this.lastFormElement=function(){var Q,P,O=M.elements.length;for(Q=O-1;Q>=0;Q--){P=M.elements[Q];if(P.focus&&!P.disabled&&P.type!="hidden"){return P;}}return null;}();if(this.cfg.getProperty("modal")){K=this.firstFormElement||this.firstButton;if(K){this.preventBackTab=new B(K,{shift:true,keys:9},{fn:L.focusLast,scope:L,correctScope:true});this.showEvent.subscribe(this.preventBackTab.enable,this.preventBackTab,true);this.hideEvent.subscribe(this.preventBackTab.disable,this.preventBackTab,true);}N=this.lastButton||this.lastFormElement;if(N){this.preventTabOut=new B(N,{shift:false,keys:9},{fn:L.focusFirst,scope:L,correctScope:true});this.showEvent.subscribe(this.preventTabOut.enable,this.preventTabOut,true);this.hideEvent.subscribe(this.preventTabOut.disable,this.preventTabOut,true);}}}},configClose:function(M,K,N){var O=K[0];function L(Q,P){P.cancel();}if(O){if(!this.close){this.close=document.createElement("div");D.addClass(this.close,"container-close");this.close.innerHTML="&#160;";this.innerElement.appendChild(this.close);J.on(this.close,"click",L,this);}else{this.close.style.display="block";}}else{if(this.close){this.close.style.display="none";}}},configButtons:function(U,T,O){var P=YAHOO.widget.Button,W=T[0],M=this.innerElement,V,R,L,S,Q,K,N;C.call(this);this._aButtons=null;if(E.isArray(W)){Q=document.createElement("span");Q.className="button-group";S=W.length;this._aButtons=[];for(N=0;N<S;N++){V=W[N];if(P){L=new P({label:V.text,container:Q});R=L.get("element");if(V.isDefault){L.addClass("default");this.defaultHtmlButton=R;}if(E.isFunction(V.handler)){L.set("onclick",{fn:V.handler,obj:this,scope:this});}else{if(E.isObject(V.handler)&&E.isFunction(V.handler.fn)){L.set("onclick",{fn:V.handler.fn,obj:((!E.isUndefined(V.handler.obj))?V.handler.obj:this),scope:(V.handler.scope||this)});}}this._aButtons[this._aButtons.length]=L;}else{R=document.createElement("button");R.setAttribute("type","button");if(V.isDefault){R.className="default";this.defaultHtmlButton=R;}R.innerHTML=V.text;if(E.isFunction(V.handler)){J.on(R,"click",V.handler,this,true);}else{if(E.isObject(V.handler)&&E.isFunction(V.handler.fn)){J.on(R,"click",V.handler.fn,((!E.isUndefined(V.handler.obj))?V.handler.obj:this),(V.handler.scope||this));}}Q.appendChild(R);this._aButtons[this._aButtons.length]=R;}V.htmlButton=R;if(N===0){this.firstButton=R;}if(N==(S-1)){this.lastButton=R;}}this.setFooter(Q);K=this.footer;if(D.inDocument(this.element)&&!D.isAncestor(M,K)){M.appendChild(K);}this.buttonSpan=Q;}else{Q=this.buttonSpan;K=this.footer;if(Q&&K){K.removeChild(Q);this.buttonSpan=null;this.firstButton=null;this.lastButton=null;this.defaultHtmlButton=null;}}this.cfg.refireEvent("iframe");this.cfg.refireEvent("underlay");},getButtons:function(){var K=this._aButtons;if(K){return K;}},focusFirst:function(N,L,P){var M=this.firstFormElement,K;if(L){K=L[1];if(K){J.stopEvent(K);}}if(M){try{M.focus();}catch(O){}}else{this.focusDefaultButton();}},focusLast:function(N,L,P){var Q=this.cfg.getProperty("buttons"),M=this.lastFormElement,K;if(L){K=L[1];if(K){J.stopEvent(K);}}if(Q&&E.isArray(Q)){this.focusLastButton();}else{if(M){try{M.focus();}catch(O){}}}},focusDefaultButton:function(){var K=this.defaultHtmlButton;if(K){try{K.focus();}catch(L){}}},blurButtons:function(){var P=this.cfg.getProperty("buttons"),M,O,L,K;if(P&&E.isArray(P)){M=P.length;if(M>0){K=(M-1);do{O=P[K];if(O){L=O.htmlButton;if(L){try{L.blur();}catch(N){}}}}while(K--);}}},focusFirstButton:function(){var N=this.cfg.getProperty("buttons"),M,K;if(N&&E.isArray(N)){M=N[0];if(M){K=M.htmlButton;if(K){try{K.focus();}catch(L){}}}}},focusLastButton:function(){var O=this.cfg.getProperty("buttons"),L,N,K;if(O&&E.isArray(O)){L=O.length;if(L>0){N=O[(L-1)];if(N){K=N.htmlButton;if(K){try{K.focus();}catch(M){}}}}}},configPostMethod:function(L,K,M){this.registerForm();},validate:function(){return true;},submit:function(){if(this.validate()){this.beforeSubmitEvent.fire();this.doSubmit();this.submitEvent.fire();if(this.cfg.getProperty("hideaftersubmit")){this.hide();}return true;}else{return false;}},cancel:function(){this.cancelEvent.fire();this.hide();},getData:function(){var a=this.form,M,T,W,O,U,R,Q,L,X,N,Y,b,K,P,c,Z,V;function S(e){var d=e.tagName.toUpperCase();return((d=="INPUT"||d=="TEXTAREA"||d=="SELECT")&&e.name==O);}if(a){M=a.elements;T=M.length;W={};for(Z=0;Z<T;Z++){O=M[Z].name;U=D.getElementsBy(S,"*",a);R=U.length;if(R>0){if(R==1){U=U[0];Q=U.type;L=U.tagName.toUpperCase();switch(L){case"INPUT":if(Q=="checkbox"){W[O]=U.checked;}else{if(Q!="radio"){W[O]=U.value;}}break;case"TEXTAREA":W[O]=U.value;break;case"SELECT":X=U.options;N=X.length;Y=[];for(V=0;V<N;V++){b=X[V];if(b.selected){K=b.value;if(!K||K===""){K=b.text;}Y[Y.length]=K;}}W[O]=Y;break;}}else{Q=U[0].type;switch(Q){case"radio":for(V=0;V<R;V++){P=U[V];if(P.checked){W[O]=P.value;break;}}break;case"checkbox":Y=[];for(V=0;V<R;V++){c=U[V];if(c.checked){Y[Y.length]=c.value;}}W[O]=Y;break;}}}}}return W;},destroy:function(){C.call(this);this._aButtons=null;var K=this.element.getElementsByTagName("form"),L;if(K.length>0){L=K[0];if(L){J.purgeElement(L);if(L.parentNode){L.parentNode.removeChild(L);}this.form=null;}}F.superclass.destroy.call(this);},toString:function(){return"Dialog "+this.id;}});}());(function(){YAHOO.widget.SimpleDialog=function(E,D){YAHOO.widget.SimpleDialog.superclass.constructor.call(this,E,D);};var C=YAHOO.util.Dom,B=YAHOO.widget.SimpleDialog,A={"ICON":{key:"icon",value:"none",suppressEvent:true},"TEXT":{key:"text",value:"",suppressEvent:true,supercedes:["icon"]}};B.ICON_BLOCK="blckicon";B.ICON_ALARM="alrticon";B.ICON_HELP="hlpicon";B.ICON_INFO="infoicon";B.ICON_WARN="warnicon";B.ICON_TIP="tipicon";B.ICON_CSS_CLASSNAME="yui-icon";B.CSS_SIMPLEDIALOG="yui-simple-dialog";YAHOO.extend(B,YAHOO.widget.Dialog,{initDefaultConfig:function(){B.superclass.initDefaultConfig.call(this);this.cfg.addProperty(A.ICON.key,{handler:this.configIcon,value:A.ICON.value,suppressEvent:A.ICON.suppressEvent});this.cfg.addProperty(A.TEXT.key,{handler:this.configText,value:A.TEXT.value,suppressEvent:A.TEXT.suppressEvent,supercedes:A.TEXT.supercedes});},init:function(E,D){B.superclass.init.call(this,E);this.beforeInitEvent.fire(B);C.addClass(this.element,B.CSS_SIMPLEDIALOG);this.cfg.queueProperty("postmethod","manual");if(D){this.cfg.applyConfig(D,true);}this.beforeRenderEvent.subscribe(function(){if(!this.body){this.setBody("");}},this,true);this.initEvent.fire(B);},registerForm:function(){B.superclass.registerForm.call(this);this.form.innerHTML+='<input type="hidden" name="'+this.id+'" value=""/>';},configIcon:function(F,E,J){var K=E[0],D=this.body,I=B.ICON_CSS_CLASSNAME,H,G;if(K&&K!="none"){H=C.getElementsByClassName(I,"*",D);if(H){G=H.parentNode;if(G){G.removeChild(H);H=null;}}if(K.indexOf(".")==-1){H=document.createElement("span");H.className=(I+" "+K);H.innerHTML="&#160;";}else{H=document.createElement("img");H.src=(this.imageRoot+K);H.className=I;}if(H){D.insertBefore(H,D.firstChild);}}},configText:function(E,D,F){var G=D[0];if(G){this.setBody(G);this.cfg.refireEvent("icon");}},toString:function(){return"SimpleDialog "+this.id;}});}());(function(){YAHOO.widget.ContainerEffect=function(F,I,H,E,G){if(!G){G=YAHOO.util.Anim;}this.overlay=F;this.attrIn=I;this.attrOut=H;this.targetElement=E||F.element;this.animClass=G;};var B=YAHOO.util.Dom,D=YAHOO.util.CustomEvent,C=YAHOO.util.Easing,A=YAHOO.widget.ContainerEffect;A.FADE=function(E,G){var I={attributes:{opacity:{from:0,to:1}},duration:G,method:C.easeIn};var F={attributes:{opacity:{to:0}},duration:G,method:C.easeOut};var H=new A(E,I,F,E.element);H.handleUnderlayStart=function(){var K=this.overlay.underlay;if(K&&YAHOO.env.ua.ie){var J=(K.filters&&K.filters.length>0);if(J){B.addClass(E.element,"yui-effect-fade");}}};H.handleUnderlayComplete=function(){var J=this.overlay.underlay;if(J&&YAHOO.env.ua.ie){B.removeClass(E.element,"yui-effect-fade");}};H.handleStartAnimateIn=function(K,J,L){B.addClass(L.overlay.element,"hide-select");if(!L.overlay.underlay){L.overlay.cfg.refireEvent("underlay");}L.handleUnderlayStart();B.setStyle(L.overlay.element,"visibility","visible");B.setStyle(L.overlay.element,"opacity",0);};H.handleCompleteAnimateIn=function(K,J,L){B.removeClass(L.overlay.element,"hide-select");if(L.overlay.element.style.filter){L.overlay.element.style.filter=null;}L.handleUnderlayComplete();L.overlay.cfg.refireEvent("iframe");L.animateInCompleteEvent.fire();};H.handleStartAnimateOut=function(K,J,L){B.addClass(L.overlay.element,"hide-select");L.handleUnderlayStart();};H.handleCompleteAnimateOut=function(K,J,L){B.removeClass(L.overlay.element,"hide-select");if(L.overlay.element.style.filter){L.overlay.element.style.filter=null;}B.setStyle(L.overlay.element,"visibility","hidden");B.setStyle(L.overlay.element,"opacity",1);L.handleUnderlayComplete();L.overlay.cfg.refireEvent("iframe");L.animateOutCompleteEvent.fire();};H.init();return H;};A.SLIDE=function(G,I){var F=G.cfg.getProperty("x")||B.getX(G.element),K=G.cfg.getProperty("y")||B.getY(G.element),J=B.getClientWidth(),H=G.element.offsetWidth,E=new A(G,{attributes:{points:{to:[F,K]}},duration:I,method:C.easeIn},{attributes:{points:{to:[(J+25),K]}},duration:I,method:C.easeOut},G.element,YAHOO.util.Motion);E.handleStartAnimateIn=function(M,L,N){N.overlay.element.style.left=((-25)-H)+"px";N.overlay.element.style.top=K+"px";};E.handleTweenAnimateIn=function(O,N,P){var Q=B.getXY(P.overlay.element),M=Q[0],L=Q[1];if(B.getStyle(P.overlay.element,"visibility")=="hidden"&&M<F){B.setStyle(P.overlay.element,"visibility","visible");}P.overlay.cfg.setProperty("xy",[M,L],true);P.overlay.cfg.refireEvent("iframe");};E.handleCompleteAnimateIn=function(M,L,N){N.overlay.cfg.setProperty("xy",[F,K],true);N.startX=F;N.startY=K;N.overlay.cfg.refireEvent("iframe");N.animateInCompleteEvent.fire();};E.handleStartAnimateOut=function(M,L,P){var N=B.getViewportWidth(),Q=B.getXY(P.overlay.element),O=Q[1];P.animOut.attributes.points.to=[(N+25),O];};E.handleTweenAnimateOut=function(N,M,O){var Q=B.getXY(O.overlay.element),L=Q[0],P=Q[1];O.overlay.cfg.setProperty("xy",[L,P],true);O.overlay.cfg.refireEvent("iframe");};E.handleCompleteAnimateOut=function(M,L,N){B.setStyle(N.overlay.element,"visibility","hidden");N.overlay.cfg.setProperty("xy",[F,K]);N.animateOutCompleteEvent.fire();};E.init();return E;};A.prototype={init:function(){this.beforeAnimateInEvent=this.createEvent("beforeAnimateIn");this.beforeAnimateInEvent.signature=D.LIST;this.beforeAnimateOutEvent=this.createEvent("beforeAnimateOut");this.beforeAnimateOutEvent.signature=D.LIST;this.animateInCompleteEvent=this.createEvent("animateInComplete");this.animateInCompleteEvent.signature=D.LIST;this.animateOutCompleteEvent=this.createEvent("animateOutComplete");this.animateOutCompleteEvent.signature=D.LIST;this.animIn=new this.animClass(this.targetElement,this.attrIn.attributes,this.attrIn.duration,this.attrIn.method);this.animIn.onStart.subscribe(this.handleStartAnimateIn,this);this.animIn.onTween.subscribe(this.handleTweenAnimateIn,this);this.animIn.onComplete.subscribe(this.handleCompleteAnimateIn,this);this.animOut=new this.animClass(this.targetElement,this.attrOut.attributes,this.attrOut.duration,this.attrOut.method);this.animOut.onStart.subscribe(this.handleStartAnimateOut,this);this.animOut.onTween.subscribe(this.handleTweenAnimateOut,this);this.animOut.onComplete.subscribe(this.handleCompleteAnimateOut,this);},animateIn:function(){this.beforeAnimateInEvent.fire();this.animIn.animate();},animateOut:function(){this.beforeAnimateOutEvent.fire();this.animOut.animate();},handleStartAnimateIn:function(F,E,G){},handleTweenAnimateIn:function(F,E,G){},handleCompleteAnimateIn:function(F,E,G){},handleStartAnimateOut:function(F,E,G){},handleTweenAnimateOut:function(F,E,G){},handleCompleteAnimateOut:function(F,E,G){},toString:function(){var E="ContainerEffect";if(this.overlay){E+=" ["+this.overlay.toString()+"]";}return E;}};YAHOO.lang.augmentProto(A,YAHOO.util.EventProvider);})();YAHOO.register("container",YAHOO.widget.Module,{version:"2.5.1",build:"984"});function CreateNamespace(){for(var A=0;A<arguments.length;A++){var D=arguments[A].split(".");var C=window;for(var B=0;B<D.length;B++){if(!C[D[B]]){C[D[B]]=new Object()}C=C[D[B]]}}}CreateNamespace("Pol.VI");Pol.VI.ConfigParams={BaseUrl:"http://in.pictometry.com/ImageNavigator/"};Pol.VI.ImageLevel={Neighborhood:"N",Community:"C"};Pol.VI.ImageType={Orthogonal:"Or",Oblique:"Ob"};Pol.VI.Orientation={North:"N",East:"E",South:"S",West:"W"};Pol.VI.Events={onclick:null,ondblclick:null,onmousedown:null,onmouseup:null,oncontextmenu:null,onstartmeasurement:null,onendmeasurement:null,onstartselect:null,onendselect:null,onviewchange:null,onscalechange:null,onresize:null,onedgedetect:null,onstartcontinuouspan:null,onstopcontinuouspan:null,onoverlayrendered:null,onnavigatefail:null,ongroundplanechange:null,onerror:null};Pol.VI.ImageEvent={mouse:{x:0,y:0},image:{x:0,y:0},type:null,target:null};Pol.VI.ViewEvent={view:{level:0,type:0,orientation:0},scale:1};Pol.VI.InfoEvent={status:0,reason:"OK"};Pol.VI.KeyEvent={type:null,keycode:0};Pol.VI.Status={status:0,reason:"OK",OK:{status:0,reason:"OK"},NoImagesAvailable:{status:1,reason:"No Images Available"},ServerError:{status:2,reason:"Server Error"},ServiceUnavailable:{status:3,reason:"Service Unavailable"},BadRequest:{status:4,reason:"Bad Request"},AuthorizationFailed:{status:5,reason:"Authorization Failed"},AccessDenied:{status:6,reason:"Access Denied"},UnknownRequest:{status:7,reason:"Unkown Request"},IncompleteRequest:{status:8,reason:"Incomplete Request"},DatabaseError:{status:9,reason:"Database Error"},BadResponse:{status:10,reason:"Bad Response Data"},SetViewFailed:{status:11,reason:"Set View Failed"},GeoBoundaryExceeded:{status:12,reason:"Geographic Boundary Exceeded"},NoDataAvailable:{status:13,reason:"No Data Available"}};Pol.VI.SearchRange={MostRecent:"M",LeastRecent:"L"};Pol.VI.SearchFilter={range:Pol.VI.SearchRange.MostRecent,depth:5};Pol.VI.Translate={LocationToImage:0,ImageToLocation:1};Pol.VI.DistanceUnits={Inches:0,Feet:1,Yards:2,Miles:3,Millimeters:4,Centimeters:5,Meters:6,Kilometers:7,NauticalMiles:8};Pol.VI.AreaUnits={SquareInches:0,SquareFeet:1,SquareYards:2,SquareMiles:3,SquareMillimeters:4,SquareCentimeters:5,SquareMeters:6,SquareKilometers:7,Acres:8,Hectares:9};Pol.VI.LocationUnits={Degrees:0,Radians:1};Pol.VI.AngleUnits={Degrees:0,Radians:1};Pol.VI.CoordinateFormats={DecimalDegree:0,DegreeMinute:1,DegreeMinuteSecond:2};Pol.VI.ExportTypes={Image:0,WorldFile:1,KML:2};Pol.VI.ImageFormats={JPEG:0,GIF:1,PNG:2};Pol.VI.ImageOptions={Date:1,NorthPointer:2};Pol.VI.AccessControl={Allow:0,Deny:1};YAHOO.util.CustomEvent.prototype.notify=function(B){var A=this.subscribers.length;for(var C=0;C<A;C++){var E=this.subscribers[C];if(E){var D=(E.override)?E.obj:this.scope;E.fn.call(D,B,E.obj)}}};Pol.VI.ImageNavigator=function(B,C){this.viewer=null;this.TileSize=256;this.EdgeLimit=100;this.ScaleFactor=1;this.ScaledPixels=Math.round(this.TileSize*this.ScaleFactor);this.HitSet={};this.OriginHitSet={};this.CurrentView=null;this.SearchFilter={range:Pol.VI.SearchRange.MostRecent,depth:5};this.SelectedView={level:Pol.VI.ImageLevel.Neighborhood,type:Pol.VI.ImageType.Oblique,orientation:Pol.VI.Orientation.North};this.AutoNavigate=false;this.EnableMousePan=true;this.EnableMouseWheelZoom=false;this.MouseWheelScaleIncr=0.25;this.EdgeDetected=false;this.Events=[];this.EventsList=["onclick","ondblclick","onmousedown","onmouseup","onmouseover","onmouseout","oncontextmenu","onstartmeasurement","onendmeasurement","onstartselect","onendselect","onviewchange","onscalechange","onresize","onedgedetect","onstartcontinuouspan","onstopcontinuouspan","onoverlayrendered","onnavigatefail","ongroundplanechange","onkeydown","onkeyup","onerror"];this.ServerProxy=null;this.ScoreBias=1;this.TileServers=["http://ts0.pictometry.com/","http://ts1.pictometry.com/","http://ts2.pictometry.com/","http://ts3.pictometry.com/"];this.EdgeTile=new Image(this.TileSize,this.TileSize);this.MissingTile=new Image(this.TileSize,this.TileSize);this.GrabCursor="default";this.GrabbingCursor="default";this.NavigateCursor="url("+Pol.VI.ConfigParams.BaseUrl+"i/cursors/navigate.cur),pointer";this.NavigateOnSelect=false;this.ContinuousPanEnabled=false;this.SuppressPanning=false;this.HasPanned=false;this.TimerId=null;this.RequestTimeout=10000;this.StatisticsTimerId=null;this.StatisticsInterval=5000;this.ViewerElements=[];this.UserId=null;this.Statistics={searches:0,views:0,exports:0};this.ContinuousPanInterval=125;this.RequestType={Search:1,Navigate:2,Translate:3,Measure:4,Metadata:5,Bounds:6,Overlay:7,Export:8,Compute:9,Statistics:10,Link:11,Contour:12};this.ExportOverlay=false;this.Xpos=false;this.Xneg=false;this.Ypos=false;this.Yneg=false;this.AccessControlList=[[],[]];this.GeoFenceList=[];this.Logo=null;this.LogoText="";this.GroundPlane={capture:false,active:false,elevation:0,offset:0};this.TransactionObjs={search:null,navigate:null,translate:null};this.ViewFlags={isPar:1};this.Version="1.0.3.8";if(typeof B=="string"){B=document.getElementById(B)}if(B==null){return false}if(C==undefined){return false}if(C.UserId!=undefined){this.UserId=C.UserId}else{return false}if(C.ServerProxy!=undefined){this.ServerProxy=C.ServerProxy}else{return false}if(C.BaseUrl){Pol.VI.ConfigParams.BaseUrl=C.BaseUrl}if(C.SSL){Pol.VI.ConfigParams.BaseUrl=Pol.VI.ConfigParams.BaseUrl.replace(/http/,"https");for(var A=0;A<this.TileServers.length;A++){this.TileServers[A]=this.TileServers[A].replace(/http/,"https")}}if(C.TileServers!=undefined){this.TileServers.length=0;for(var A=0;A<C.TileServers.length;A++){this.TileServers.push(C.TileServers[A])}}if(C.AutoNavigate!=undefined){this.AutoNavigate=C.AutoNavigate}if(C.EnableMousePan!=undefined){this.EnableMousePan=C.EnableMousePan}if(C.EnableMouseWheelZoom!=undefined){this.EnableMouseWheelZoom=C.EnableMouseWheelZoom}this.viewer=B;this.viewer.portal=document.createElement("div");this.viewer.overlay=document.createElement("div");YAHOO.util.Dom.generateId(this.viewer.portal,"pol-vi-portal");this.viewer.portal.className="pol-vi-portal";YAHOO.util.Dom.generateId(this.viewer.overlay,"pol-vi-overlay");this.viewer.overlay.className="pol-vi-overlay";YAHOO.util.Dom.setStyle(this.viewer.overlay,"background-image","url("+Pol.VI.ConfigParams.BaseUrl+"i/transparentpixel.gif)");this.viewer.portal.style.cursor="default";this.viewer.overlay.style.cursor="default";this.viewer.portal.style.width=this.viewer.style.width;this.viewer.portal.style.height=this.viewer.style.height;this.viewer.overlay.style.width=this.viewer.style.width;this.viewer.overlay.style.height=this.viewer.style.height;this.viewer.appendChild(this.viewer.portal);this.viewer.appendChild(this.viewer.overlay);this.ViewerElements.push(this.viewer);this.ViewerElements.push(this.viewer.portal);this.EdgeTile.src=Pol.VI.ConfigParams.BaseUrl+"i/edgetile.png";this.MissingTile.src=Pol.VI.ConfigParams.BaseUrl+"i/missingtile.png";this.Init=function(){try{document.execCommand("BackgroundImageCache",false,true)}catch(F){}this.viewer.style.display="block";var E=this.viewer.offsetWidth;var D=this.viewer.offsetHeight;this.viewer.style.width=E+"px";this.viewer.style.height=D+"px";this.viewer.dimensions={width:E,height:D,halfwidth:Math.round(E/2),halfheight:Math.round(D/2),tilesize:this.ScaledPixels,x:0,y:0};this.viewer.start={x:0,y:0};this.viewer.selected=false;this._CreateTiles();this._CreateEvents();this._SetCursors();this._InitOverlay();this._InitTools();this._InitExport();this._InitStatistics();this._InitLogo()};this._SenseSelect=function(F,K){var J=YAHOO.util.Event.getXY(F);var H=K._GetXY(K.viewer,J[0],J[1]);K.HasPanned=false;if(K.IsViewActive()){if(K.NavigateOnSelect){var E=K.CurrentView;var I=K.viewer.dimensions;var G=(H.x-I.halfwidth)+E.mx;var D=(H.y-I.halfheight)+E.my;K.viewer.overlay.style.cursor=K.GrabCursor;K.EdgeDetected=true;K.SetCenter(G,D);K._Navigate({isWalkingMan:true})}else{if(K.EnableMousePan){K.viewer.selected=true;K.viewer.start={x:H.x,y:H.y};K.viewer.overlay.style.cursor=K.GrabbingCursor;YAHOO.util.Event.removeListener(K.viewer.overlay,"mousemove",K._SenseMove);YAHOO.util.Event.addListener(K.viewer.overlay,"mousemove",K._SenseMove,K)}}K._OnMouseEventHandler(F,K)}};this._SenseRelease=function(E,J){var K=J.viewer;if(K.selected){var I=YAHOO.util.Event.getXY(E);var H=K.dimensions;var G=J._GetXY(K,I[0],I[1]);var F=Math.round((G.x-K.start.x)/J.ScaleFactor);var D=Math.round((G.y-K.start.y)/J.ScaleFactor);YAHOO.util.Event.removeListener(K.overlay,"mousemove",J._SenseMove);K.overlay.style.cursor=J.GrabCursor;K.selected=false;H.x+=(G.x-K.start.x);H.y+=(G.y-K.start.y);J._UpdateView(J,F,D);J._UpdateOverlay(J,F,D,false);J._OnMouseEventHandler(E,J)}};this._SenseMove=function(D,G){var F=YAHOO.util.Event.getXY(D);var E=G._GetXY(G.viewer,F[0],F[1]);if(G.SuppressPanning){return}G.HasPanned=true;G._PositionTiles(G,{x:E.x,y:E.y},false);G._PositionOverlay(G,{x:E.x,y:E.y})};this._OnMouseMove=function(O,G){if(G.AutoNavigate&&(G.CurrentView!=null)&&(G.viewer.selected==false)){var P=YAHOO.util.Event.getXY(O);var H=G._GetXY(G.viewer,P[0],P[1]);var K=G.CurrentView;var I=G.viewer.dimensions.halfwidth/G.ScaleFactor;var F=G.viewer.dimensions.halfheight/G.ScaleFactor;var N=H.x/G.ScaleFactor;var L=H.y/G.ScaleFactor;var E=(((K.mx-I)+N)<=G.EdgeLimit);var J=(((K.my-F)+L)<=G.EdgeLimit);var M=((K.width-(K.mx+N-I))<=G.EdgeLimit);var D=((K.height-(K.my+L-F))<=G.EdgeLimit);if(E||M||J||D){G.NavigateOnSelect=true;G.viewer.overlay.style.cursor=G.NavigateCursor;G.viewer.portal.style.cursor=G.NavigateCursor}else{G.NavigateOnSelect=false;G.viewer.overlay.style.cursor=G.GrabCursor;G.viewer.portal.style.cursor="default"}}};this._GetXY=function(G,D,H){var E={x:D,y:H};for(var F=G;F;F=F.offsetParent){E.x-=F.offsetLeft;E.y-=F.offsetTop}return E};this._CreateTiles=function(){this.viewer.tiles=[];var G=Math.ceil(this.viewer.dimensions.height/this.viewer.dimensions.tilesize)+1;var H=Math.ceil(this.viewer.dimensions.width/this.viewer.dimensions.tilesize)+1;for(var I=0;I<H;I++){var D=[];for(var F=0;F<G;F++){var E={c:I,r:F,img:document.createElement("img"),viewer:this.viewer};E.img.className="pol-vi-tile";E.img.style.width=this.viewer.dimensions.tilesize+"px";E.img.style.height=this.viewer.dimensions.tilesize+"px";E.img.src=this.MissingTile.src;E.img.style.top=(F*this.ScaledPixels)+"px";E.img.style.left=(I*this.ScaledPixels)+"px";this.viewer.portal.appendChild(E.img);D.push(E)}this.viewer.tiles.push(D)}this.viewer.tiles.rightedge=(H*this.viewer.dimensions.tilesize)-this.viewer.dimensions.tilesize;this.viewer.tiles.bottomedge=(G*this.viewer.dimensions.tilesize)-this.viewer.dimensions.tilesize};this._GetTileServer=function(D){return this.TileServers[D%this.TileServers.length]};this._BuildTileUrl=function(D,G,F){var E;if(D.flags&this.ViewFlags.isPar){E=this._GetTileServer(G+F)+"tiles/?i="+D.path+D.index+"&s=1.0&c="+G+"&r="+F+"&t="+this.UserId}else{E=this._GetTileServer(G+F)+D.path+D.index+"/"+G+"-"+F+".jpg?t="+this.UserId}return E};this._BuildThumbUrl=function(D){var E;if(D.flags&this.ViewFlags.isPar){E=this._GetTileServer(0)+"thumbs/?i="+D.path+D.index+"&t="+this.UserId}else{E=this._GetTileServer(0)+D.path+D.index+"/thumb.jpg?t="+this.UserId}return E};this._OnLoadTile=function(D){this.style.display="block"};this._OnErrorTile=function(D){var E=this.src;this.onerror=null;this.src=E};this._OnAbortTile=function(D){var E=this.src;this.onabort=null;this.src=E};this._LoadTile=function(E){var D=this.CurrentView;var F=(E.c<0)||(E.r<0)||(E.c>=(Math.round(D.width*this.ScaleFactor)/this.ScaledPixels))||(E.r>=(Math.round(D.height*this.ScaleFactor)/this.ScaledPixels));if(F){E.img.onload=null;E.img.onerror=null;E.img.onabort=null;E.img.src=null;E.img.style.display="none"}else{E.img.style.display="none";E.img.onload=this._OnLoadTile;E.img.onerror=this._OnErrorTile;E.img.onabort=this._OnAbortTile;E.img.src=this._BuildTileUrl(D,E.c,E.r)}};this._PositionTiles=function(F,H,E){var R=F.viewer.tiles;var G=F.viewer.dimensions;var K=G.tilesize;var I=K*-1;var Q=G.x+(H.x-F.viewer.start.x);var O=G.y+(H.y-F.viewer.start.y);for(var M=0,N=R.length;M<N;M++){for(var D=0,P=R[M].length;D<P;D++){var J=R[M][D];var L=false;J.x=(J.c*K)+Q;J.y=(J.r*K)+O;if(J.x>R.rightedge){do{J.c-=R.length;J.x=(J.c*K)+Q;L=true}while(J.x>G.width)}else{while(J.x<I){J.c+=R.length;J.x=(J.c*K)+Q;L=true}}if(J.y>R.bottomedge){do{J.r-=R[M].length;J.y=(J.r*K)+O;L=true}while(J.y>G.height)}else{while(J.y<I){J.r+=R[M].length;J.y=(J.r*K)+O;L=true}}J.img.style.top=Math.round(J.y)+"px";J.img.style.left=Math.round(J.x)+"px";if(E||L){F._LoadTile(J)}}}};this._UnloadTiles=function(){for(var F=0;F<this.viewer.tiles.length;F++){var D=this.viewer.tiles[F];for(var G=0;G<D.length;G++){var E=D[G];this.viewer.portal.removeChild(E.img);delete(E.img);delete(D[G])}delete(this.viewer.tiles[F])}this.viewer.tiles=null};this._IsViewValid=function(I,G,E){var D=false;var F=false;var H=false;switch(I){case Pol.VI.ImageLevel.Neighborhood:case Pol.VI.ImageLevel.Community:D=true;break;default:break}switch(G){case Pol.VI.ImageType.Oblique:F=true;switch(E){case Pol.VI.Orientation.North:case Pol.VI.Orientation.East:case Pol.VI.Orientation.South:case Pol.VI.Orientation.West:H=true;break;default:break}break;case Pol.VI.ImageType.Orthogonal:F=true;switch(E){case Pol.VI.Orientation.North:H=true;break;default:break}break;default:break}return D&&F&&H};this._GetBucketIndex=function(I,G,E){var D;var F;var H;switch(I){case Pol.VI.ImageLevel.Neighborhood:D=0;break;case Pol.VI.ImageLevel.Community:D=5;break;default:return-1}switch(G){case Pol.VI.ImageType.Oblique:F=0;break;case Pol.VI.ImageType.Orthogonal:F=4;break;default:return-1}switch(E){case Pol.VI.Orientation.North:H=0;break;case Pol.VI.Orientation.East:H=1;break;case Pol.VI.Orientation.South:H=2;break;case Pol.VI.Orientation.West:H=3;break;default:return-1}return D+F+H};this.Search=function(K,H,D,G){var I=(G==undefined)?null:G;if(YAHOO.util.Connect.isCallInProgress(this.TransactionObjs.search)){YAHOO.util.Connect.abort(this.TransactionObjs.search)}if(this._IsLatLonValid(K,H)){if(this._IsWithinFence(K,H)){var F=this.ServerProxy+"?id="+this.UserId+"&type="+this.RequestType.Search+"&x="+H+"&y="+K+"&sb="+this.ScoreBias+"&sy="+this.SearchFilter.range+"&bd="+this.SearchFilter.depth+"&ac="+YAHOO.lang.JSON.stringify(this.AccessControlList);var J={success:this._SearchSuccess,failure:this._SearchFailure,scope:this,timeout:this.RequestTimeout,argument:{fn:D,data:I}};this.CurrentView=null;this.Statistics.searches++;YAHOO.util.Connect.initHeader("If-Modified-Since","Sat, 1 Jan 2000 00:00:00 GMT");this.TransactionObjs.search=YAHOO.util.Connect.asyncRequest("GET",F,J)}else{var E={status:Pol.VI.Status.GeoBoundaryExceeded.status,reason:Pol.VI.Status.GeoBoundaryExceeded.reason};if(I!=null){E.data=I}D(E)}}else{var E={status:Pol.VI.Status.BadRequest.status,reason:Pol.VI.Status.BadRequest.reason};if(I!=null){E.data=I}D(E)}};this._SearchSuccess=function(G){if(this.TransactionObjs.search.tId==G.tId){var E=this._GetStatus(G);try{this.HitSet=YAHOO.lang.JSON.parse(G.responseText);this.OriginHitSet=this.HitSet;for(var D=0;D<this.HitSet.images.length;D++){this.HitSet.images[D].iindex=0}}catch(F){E={status:Pol.VI.Status.BadResponse.status,reason:Pol.VI.Status.BadResponse.reason}}G.argument.fn(E)}};this._SearchFailure=function(E){var D=this._GetStatus(E);this.HitSet={};this.OriginHitSet={};this.ClearView(this.MissingTile.src);E.argument.fn(D)};this.GetSearchFilter=function(){return this.SearchFilter};this.SetSearchFilter=function(D){if(D.range){this.SearchFilter.range=D.range}if(D.depth){this.SearchFilter.depth=D.depth}};this.Navigate=function(){this._Navigate({isWalkingMan:false})};this._Navigate=function(E){if(YAHOO.util.Connect.isCallInProgress(this.TransactionObjs.navigate)){YAHOO.util.Connect.abort(this.TransactionObjs.navigate)}this.SuppressPanning=true;var F="["+this.Yneg+","+this.Ypos+","+this.Xneg+","+this.Xpos+"]";this.Yneg=this.Ypos=this.Xneg=this.Xpos=false;this.Statistics.searches++;var D=this.ServerProxy+"?id="+this.UserId+"&type="+this.RequestType.Navigate+"&table="+this.CurrentView.table+"&index="+this.CurrentView.index+"&x="+this.CurrentView.mx+"&y="+this.CurrentView.my+"&sb="+this.ScoreBias+"&sy="+this.SearchFilter.range+"&bd="+this.SearchFilter.depth+"&db="+F+"&ac="+YAHOO.lang.JSON.stringify(this.AccessControlList);this.CurrentView=null;var G={success:this._NavigateSuccess,failure:this._NavigateFailure,timeout:this.RequestTimeout,scope:this,argument:{isWalkingMan:E.isWalkingMan?E.isWalkingMan:false}};YAHOO.util.Connect.initHeader("If-Modified-Since","Sat, 1 Jan 2000 00:00:00 GMT");this.TransactionObjs.navigate=YAHOO.util.Connect.asyncRequest("GET",D,G)};this._NavigateSuccess=function(H){if(this.TransactionObjs.navigate.tId==H.tId){var D=this.SelectedView;var F={nosync:true,fireviewchange:true,isWalkingMan:H.argument.isWalkingMan};try{this.HitSet=YAHOO.lang.JSON.parse(H.responseText);if(this._IsWithinFence(this.HitSet.region.y,this.HitSet.region.x)){for(var E=0;E<this.HitSet.images.length;E++){this.HitSet.images[E].iindex=0}if(this.SetView(D.level,D.type,D.orientation,F)==false){this.Events.onnavigatefail.notify(Pol.VI.Status.SetViewFailed)}}else{this.SetView(D.level,D.type,D.orientation,F);this.Events.onnavigatefail.notify(Pol.VI.Status.GeoBoundaryExceeded)}}catch(G){this.Events.onnavigatefail.notify(Pol.VI.Status.BadResponse)}}};this._NavigateFailure=function(E){var D=this._GetStatus(E);this.Events.onnavigatefail.notify(D);this.SuppressPanning=false};this.GetNextImage=function(){if(this.IsViewActive()){var D=this.CurrentView.bindex;var E=this.HitSet.images[D].iindex+1;var F=(E>=this.HitSet.images[D].length)?0:E;this.HitSet.images[D].iindex=F;this.SetView(this.CurrentView.level,this.CurrentView.type,this.CurrentView.orientation,{nosync:true,fireviewchange:true})}};this.GetPrevImage=function(){if(this.IsViewActive()){var D=this.CurrentView.bindex;var E=this.HitSet.images[D].iindex-1;var F=(E<0)?this.HitSet.images[D].length-1:E;this.HitSet.images[D].iindex=F;this.SetView(this.CurrentView.level,this.CurrentView.type,this.CurrentView.orientation,{nosync:true,fireviewchange:true})}};this.GotoImage=function(E){if(this.IsViewActive()){var D=this.CurrentView.bindex;E--;if((E>=0)||(E<this.HitSet.images[D].length)){this.HitSet.images[D].iindex=E;this.SetView(this.CurrentView.level,this.CurrentView.type,this.CurrentView.orientation,{nosync:true,fireviewchange:true})}}};this.GetViewInfo=function(){var D={};if(this.IsViewActive()){var G=this.CurrentView.bindex;var E=[];for(var H=0;H<this.HitSet.images[G].length;H++){var I=this.HitSet.images[G][H];var F=this._BuildThumbUrl(I);E.push({position:H+1,name:I.name,year:I.date.year,month:I.date.month,day:I.date.day,thumb:F})}D={position:this.HitSet.images[G].iindex+1,count:this.HitSet.images[G].length,view:E}}return D};this._UpdateView=function(G,F,D){var E=G.CurrentView;if(E.mx==undefined){E.mx=E.x}if(E.my==undefined){E.my=E.y}E.mx-=F;E.my-=D};this._IsSynchronized=function(){var E=true;if(this.AutoNavigate){if(this.IsViewActive()){var D=this.CurrentView;if((D.mx!=undefined)&&(D.my!=undefined)){if((D.mx!=D.x)||(D.my!=D.y)){E=false}}}}return E};this.IsViewActive=function(){return(this.CurrentView==null)?false:true};this.SetView=function(E,K,G){var H=false;var L=null;var F=(arguments[3]!=undefined)?arguments[3]:{nosync:false,fireviewchange:true};if(this._IsViewValid(E,K,G)){this.SelectedView={level:E,type:K,orientation:G};this.ClearView();if(this._IsSynchronized()||F.nosync){var I=this._GetBucketIndex(E,K,G);if(this.HitSet.images[I].length>0){var N=this.HitSet.images[I].iindex;this.CurrentView=this.HitSet.images[I][N];this.CurrentView.bindex=I;L=this.CurrentView;if(L.x&&L.y){var J=this.viewer.dimensions;if((L.mx==undefined)&&(L.my==undefined)){J.x=(Math.round(L.x*this.ScaleFactor)-J.halfwidth)*-1;J.y=(Math.round(L.y*this.ScaleFactor)-J.halfheight)*-1;L.mx=L.x;L.my=L.y}else{J.x=(Math.round(L.mx*this.ScaleFactor)-J.halfwidth)*-1;J.y=(Math.round(L.my*this.ScaleFactor)-J.halfheight)*-1}this.viewer.start.x=this.viewer.start.y=0;this._PositionTiles(this,{x:0,y:0},true);this._AlignOverlay();this._UpdateLogo(L.cr);if(F.fireviewchange){this.Statistics.views++;var D={view:{level:E,type:K,orientation:G},scale:this.ScaleFactor,isWalkingMan:(F.isWalkingMan?F.isWalkingMan:false)};this.Events.onviewchange.notify(D)}this.SuppressPanning=false}else{var O=this;var M=function(P){O._ViewTranslateCb(P,I,N,F)};this.Translate([this.HitSet.region.y,this.HitSet.region.x],Pol.VI.Translate.LocationToImage,M)}H=true}}else{this.Navigate()}this.EdgeDetected=false}return H};this._ViewTranslateCb=function(H,D,F,G){if(H.status==0){var E=this.HitSet.images[D][F];E.x=H.points[0].x;E.y=H.points[0].y;G.nosync=true;G.fireviewchange=true;if(E===this.CurrentView){this.SetView(this.SelectedView.level,this.SelectedView.type,this.SelectedView.orientation,G)}}};this.GetView=function(){return this.SelectedView};this.ClearView=function(I){var F=(I==undefined)?this.EdgeTile.src:I;var E=this.viewer.tiles;for(var K=0,D=E.length;K<D;K++){for(var H=0,J=E[K].length;H<J;H++){var G=E[K][H];G.img.src=F}}};this.SetImageLevel=function(D){return this.IsViewActive()?this.SetView(D,this.CurrentView.type,this.CurrentView.orientation,{nosync:false,fireviewchange:true}):false};this.SetImageType=function(D){return this.IsViewActive()?this.SetView(this.CurrentView.level,D,Pol.VI.Orientation.North,{nosync:false,fireviewchange:true}):false};this.SetOrientation=function(D){return this.IsViewActive()?this.SetView(this.CurrentView.level,this.CurrentView.type,D,{nosync:false,fireviewchange:true}):false};this.SetAutoNavigate=function(D){if(D){this.AutoNavigate=true}else{this.AutoNavigate=false;this.NavigateOnSelect=false;this.viewer.overlay.style.cursor=this.GrabCursor;this.viewer.portal.style.cursor="default"}};this.GetAutoNavigate=function(){return this.AutoNavigate};this.SetMousePan=function(D){this.EnableMousePan=D;this._SetCursors()};this.GetMousePan=function(){return this.EnableMousePan};this.SetCursors=function(D){if(D.grab){this.GrabCursor="url("+D.grab+"),pointer"}if(D.grabbing){this.GrabbingCursor="url("+D.grabbing+"),pointer"}if(D.navigate){this.NavigateCursor="url("+D.navigate+"),pointer"}this.viewer.overlay.style.cursor=this.GrabCursor};this.ResetCursors=function(){this._SetCursors()};this._SetCursors=function(){if(this.EnableMousePan){this.GrabCursor="url("+Pol.VI.ConfigParams.BaseUrl+"i/cursors/grab.cur),pointer";this.GrabbingCursor="url("+Pol.VI.ConfigParams.BaseUrl+"i/cursors/grabbing.cur),move";this.viewer.overlay.style.cursor=this.GrabCursor}else{this.GrabCursor="default";this.GrabbingCursor="default";this.viewer.overlay.style.cursor=this.GrabCursor}this.NavigateCursor="url("+Pol.VI.ConfigParams.BaseUrl+"i/cursors/navigate.cur),crosshair"};this.SetMouseWheelZoom=function(D){this.EnableMouseWheelZoom=D;if(D){YAHOO.util.Event.addListener(this.viewer.overlay,"mousewheel",this._OnMouseWheel,this);YAHOO.util.Event.addListener(this.viewer.overlay,"DOMMouseScroll",this._OnMouseWheel,this);if(this.viewer.measure){YAHOO.util.Event.addListener(this.viewer.measure,"mousewheel",this._OnMouseWheel,this);YAHOO.util.Event.addListener(this.viewer.measure,"DOMMouseScroll",this._OnMouseWheel,this)}}else{YAHOO.util.Event.removeListener(this.viewer.overlay,"mousewheel",this._OnMouseWheel);YAHOO.util.Event.removeListener(this.viewer.overlay,"DOMMouseScroll",this._OnMouseWheel);if(this.viewer.measure){YAHOO.util.Event.removeListener(this.viewer.measure,"mousewheel",this._OnMouseWheel);YAHOO.util.Event.removeListener(this.viewer.measure,"DOMMouseScroll",this._OnMouseWheel)}}};this.GetMouseWheelZoom=function(){return this.EnableMouseWheelZoom};this.SetMouseWheelIncr=function(E){var D=parseFloat(E);if((D>=0.01)&&(D<=1)){this.MouseWheelScaleIncr=D}};this.GetMouseWheelIncr=function(){return this.MouseWheelScaleIncr};this._CreateEvents=function(){for(var E=0;E<this.EventsList.length;E++){var D=this.EventsList[E];this.Events[D]=new YAHOO.util.CustomEvent(D,this)}YAHOO.util.Event.addListener(this.viewer.overlay,"mousedown",this._SenseSelect,this);YAHOO.util.Event.addListener(this.viewer.portal,"mousedown",this._SenseSelect,this);YAHOO.util.Event.addListener(document,"mouseup",this._SenseRelease,this);YAHOO.util.Event.addListener(window,"mouseup",this._SenseRelease,this);YAHOO.util.Event.addListener(this.viewer.overlay,"mousemove",this._OnMouseMove,this);YAHOO.util.Event.addListener(this.viewer.portal,"mousemove",this._OnMouseMove,this);YAHOO.util.Event.addListener(this.viewer.overlay,"click",this._OnMouseEventHandler,this);YAHOO.util.Event.addListener(this.viewer.overlay,"dblclick",this._OnMouseEventHandler,this);YAHOO.util.Event.addListener(this.viewer.overlay,"contextmenu",this._OnMouseEventHandler,this);YAHOO.util.Event.addListener(this.viewer.overlay,"mouseover",this._OnMouseEventHandler,this);YAHOO.util.Event.addListener(this.viewer.overlay,"mouseout",this._OnMouseEventHandler,this);if(this.EnableMouseWheelZoom){this.SetMouseWheelZoom(true)}};this._GetEventInfo=function(F){var E=this.CurrentView;var K=this.viewer.dimensions;var J=YAHOO.util.Event.getXY(F);var H=this._GetXY(this.viewer,J[0],J[1]);var G=0;var D=0;G=H.x-K.halfwidth;D=H.y-K.halfheight;G=Math.round(G/this.ScaleFactor);D=Math.round(D/this.ScaleFactor);var I={mouse:{x:H.x,y:H.y},image:{x:E.mx+G,y:E.my+D}};return I};this._IsEventValid=function(D){return(this.HasPanned&&(D.type=="click"))?false:true};this._OnMouseEventHandler=function(D,G){if(G.IsViewActive()&&G._IsEventValid(D)){var H=YAHOO.util.Event.getTarget(D);var F=G._GetEventInfo(D);F.type=D.type;while(H.id!=G.viewer.overlay.id){if(H.id in G.viewer.overlay.events){var E=G.viewer.overlay.events[H.id];F.target=E;E._EventHandler(F)}H=H.parentNode;if(H==null){break}}F.target=this;G.Events["on"+D.type].notify(F);YAHOO.util.Event.preventDefault(D)}};this._OnMouseWheel=function(D,E){var G;var F;if(D.wheelDelta){if(window.opera){G=-D.wheelDelta/40}else{G=D.wheelDelta/120}}else{if(D.detail){G=-D.detail}}F=E.ScaleFactor;if(G>0){F+=E.MouseWheelScaleIncr}else{F-=E.MouseWheelScaleIncr}if((F>=0.25)&&(F<=4)){E.SetScale(F)}};this.EnableKeyDown=function(D){if(this._KeyDownListener){this._KeyDownListener.disable()}this._KeyDownListener=new YAHOO.util.KeyListener(document,D,{fn:this._OnKeyEvent,scope:this,correctScope:true},YAHOO.util.KeyListener.KEYDOWN);this._KeyDownListener.enable()};this.DisableKeyDown=function(){if(this._KeyDownListener){this._KeyDownListener.disable()}};this.EnableKeyUp=function(D){if(this._KeyUpListener){this._KeyUpListener.disable()}this._KeyUpListener=new YAHOO.util.KeyListener(document,D,{fn:this._OnKeyEvent,scope:this,correctScope:true},YAHOO.util.KeyListener.KEYUP);this._KeyUpListener.enable()};this.DisableKeyUp=function(){if(this._KeyUpListener){this._KeyUpListener.disable()}};this._OnKeyEvent=function(D,F,G){if(G.IsViewActive()){var E={type:F[1].type,keycode:F[1].keyCode};G.Events["on"+E.type].notify(E)}};this.AttachEvent=function(F,E,D){var G=false;if(D==undefined){if(F in this.Events){this.Events[F].subscribe(E,this);G=true}}else{if(Pol.VI.OverlayUtil.IsValidShape(D)&&Pol.VI.OverlayUtil.IsValidEvent(F)){this.viewer.overlay.events[D.id]=D;D._AttachEvent(F,E);G=true}}return G};this.DetachEvent=function(F,E,D){var G=false;if(D==undefined){if(F in this.Events){this.Events[F].unsubscribe(E,this);G=true}}else{if(Pol.VI.OverlayUtil.IsValidShape(D)&&Pol.VI.OverlayUtil.IsValidEvent(F)){this.viewer.overlay.events[D.id]=null;delete this.viewer.overlay.events[D.id];D._DetachEvent(F,E);G=true}}return G};this.PanImage=function(H,G){var I=this.viewer.dimensions;var K=this.CurrentView;var J=((H==0)&&(G==0));var D=false;if(this.SuppressPanning||!this.IsViewActive()){return}if(J){this.HitSet=this.OriginHitSet;var F=this._GetBucketIndex(this.SelectedView.level,this.SelectedView.type,this.SelectedView.orientation);var L=this.HitSet.images[F].iindex;this.CurrentView=this.HitSet.images[F][L];this.CurrentView.bindex=F;K=this.CurrentView;I.x=(Math.round(K.x*this.ScaleFactor)-I.halfwidth)*-1;I.y=(Math.round(K.y*this.ScaleFactor)-I.halfheight)*-1;K.mx=K.x;K.my=K.y;D=true}else{I.x+=(Math.round(H*this.ScaleFactor))*-1;I.y+=(Math.round(G*this.ScaleFactor))*-1}this.viewer.start.x=0;this.viewer.start.y=0;this._PositionTiles(this,{x:0,y:0},D);this._UpdateView(this,(H*-1),(G*-1));var N=(Math.round(H*this.ScaleFactor))*-1;var M=(Math.round(G*this.ScaleFactor))*-1;this._PositionOverlay(this,{x:N,y:M});this._UpdateOverlay(this,H,G,true);if(J){this.Statistics.views++;var E={view:{level:this.level,type:this.type,orientation:this.orientation},scale:this.ScaleFactor,isWalkingMan:false};this.Events.onviewchange.notify(E)}this.Xpos=H>0;this.Xneg=H<0;this.Ypos=G>0;this.Yneg=G<0;this._EdgeDetect(this)};this.ContinuousPan=function(E,D){var F=this;var G=function(){F.PanImage(E,D)};if(this.SuppressPanning||!this.IsViewActive()||((E==0)&&(D==0))){return}this.Events.onstartcontinuouspan.notify(Pol.VI.Status.OK);if(this.ContinuousPanEnabled&&this.TimerId){window.clearInterval(this.TimerId)}this.TimerId=null;this.ContinuousPanEnabled=true;this.TimerId=window.setInterval(G,F.ContinuousPanInterval)};this.StopContinuousPan=function(){if(this.ContinuousPanEnabled){this.ContinuousPanEnabled=false;window.clearInterval(this.TimerId);this.TimerId=null;this.Events.onstopcontinuouspan.notify(Pol.VI.Status.OK)}};this.GetCenter=function(){return this.IsViewActive()?{x:this.CurrentView.mx,y:this.CurrentView.my}:{x:-1,y:-1}};this.SetCenter=function(G,F){if(this.IsViewActive()){var E=(G/this.ScaleFactor)-(this.CurrentView.mx/this.ScaleFactor);var D=(F/this.ScaleFactor)-(this.CurrentView.my/this.ScaleFactor);this.PanImage(E,D)}};this.GetViewer=function(){return this.viewer};this.SetViewerSize=function(F,D){var G;this._UnloadTiles();for(var E=0;E<this.ViewerElements.length;E++){this.ViewerElements[E].style.width=parseInt(F)+"px";this.ViewerElements[E].style.height=parseInt(D)+"px"}this.viewer.dimensions.width=F;this.viewer.dimensions.height=D;this.viewer.dimensions.halfwidth=Math.round(F/2);this.viewer.dimensions.halfheight=Math.round(D/2);this._CreateTiles();if(this.IsViewActive()){this.SetView(this.CurrentView.level,this.CurrentView.type,this.CurrentView.orientation,{nosync:true,fireviewchange:false});G={view:{level:this.CurrentView.level,type:this.CurrentView.type,orientation:this.CurrentView.orientation},scale:this.ScaleFactor}}else{G={view:{level:-1,type:-1,orientation:-1},scale:this.ScaleFactor}}this._InitLogo();this.Events.onresize.notify(G)};this.GetViewerSize=function(){return{width:this.viewer.dimensions.width,height:this.viewer.dimensions.height}};this.GetViewerPosition=function(){var E=left=0;for(var D=this.viewer;D;D=D.offsetParent){E+=D.offsetTop;left+=D.offsetLeft}return{top:E,left:left}};this.SetScoreBias=function(D){this.ScoreBias=D};this.GetScoreBias=function(){return this.ScoreBias};this.SetScale=function(E){var D;this.ScaleFactor=E;this._UnloadTiles();this.viewer.dimensions.tilesize=this.ScaledPixels=Math.round(this.TileSize*this.ScaleFactor);this._CreateTiles();if(this.IsViewActive()){this.SetView(this.CurrentView.level,this.CurrentView.type,this.CurrentView.orientation,{nosync:true,fireviewchange:false});D={view:{level:this.CurrentView.level,type:this.CurrentView.type,orientation:this.CurrentView.orientation},scale:this.ScaleFactor}}else{D={view:{level:-1,type:-1,orientation:-1},scale:this.ScaleFactor}}this._InitLogo();this.Events.onscalechange.notify(D)};this.SetOpacity=function(D){if((D<0)||(D>1)){return}var E=Math.floor(D*100);this.viewer.portal.style.opacity=D;this.viewer.portal.style.filter="alpha(opacity="+E+")"};this.Hide=function(){this.viewer.style.visibility="hidden"};this.Show=function(){this.viewer.style.visibility="visible"};this.IsAvailable=function(G,F,E){if(this._IsViewValid(G,F,E)){var D=this._GetBucketIndex(G,F,E);return(this.HitSet.images[D].length>0)?true:false}return false};this.FindFirstOblique=function(){var F=Pol.VI.ImageLevel;var H=Pol.VI.ImageType;var G=Pol.VI.Orientation;var D=[{l:F.Neighborhood,t:H.Oblique,o:G.North},{l:F.Neighborhood,t:H.Oblique,o:G.East},{l:F.Neighborhood,t:H.Oblique,o:G.South},{l:F.Neighborhood,t:H.Oblique,o:G.West},{l:F.Community,t:H.Oblique,o:G.North},{l:F.Community,t:H.Oblique,o:G.East},{l:F.Community,t:H.Oblique,o:G.South},{l:F.Community,t:H.Oblique,o:G.West}];for(var E in D){if(this.IsAvailable(D[E].l,D[E].t,D[E].o)){return{level:D[E].l,type:D[E].t,orientation:D[E].o}}}};this.GetX=function(){return this.IsViewActive()?this.CurrentView.x:-1};this.GetY=function(){return this.IsViewActive()?this.CurrentView.y:-1};this.GetWidth=function(){return this.IsViewActive()?this.CurrentView.width:-1};this.GetHeight=function(){return this.IsViewActive()?this.CurrentView.height:-1};this.GetLevel=function(){return this.IsViewActive()?this.CurrentView.level:-1};this.GetType=function(){return this.IsViewActive()?this.CurrentView.type:-1};this.GetOrientation=function(){return this.IsViewActive()?this.CurrentView.orientation:-1};this.GetHeading=function(){return this.IsViewActive()?this.CurrentView.heading:-1};this.GetDay=function(){return this.IsViewActive()?this.CurrentView.date.day:-1};this.GetMonth=function(){return this.IsViewActive()?this.CurrentView.date.month:-1};this.GetYear=function(){return this.IsViewActive()?this.CurrentView.date.year:-1};this.GetName=function(){return this.IsViewActive()?this.CurrentView.name:null};this.GetThumbnail=function(){return this.IsViewActive()?this._BuildThumbUrl(this.CurrentView):null};this.GetScale=function(){return this.ScaleFactor};this.GetVersion=function(){return this.Version};this.GetViewPort=function(){var E;var D;var G;var F=null;if(this.IsViewActive()){E=this.CurrentView;D=Math.round(this.viewer.dimensions.halfwidth/this.ScaleFactor);G=Math.round(this.viewer.dimensions.halfheight/this.ScaleFactor);F={ul:{x:E.mx-D,y:E.my-G},ur:{x:E.mx+D,y:E.my-G},lr:{x:E.mx+D,y:E.my+G},ll:{x:E.mx-D,y:E.my+G}}}return F};this.GetCenterLatLng=function(D){if(YAHOO.util.Connect.isCallInProgress(this.TransactionObjs.translate)){YAHOO.util.Connect.abort(this.TransactionObjs.translate)}if(this.IsViewActive()){var F=[];F.push(this.CurrentView.mx);F.push(this.CurrentView.my);var E=this.ServerProxy+"?id="+this.UserId+"&type="+this.RequestType.Translate+"&table="+this.CurrentView.table+"&index="+this.CurrentView.index+"&points="+YAHOO.lang.JSON.stringify(F)+"&tt="+Pol.VI.Translate.ImageToLocation;var G={success:this._GetCenterLatLngSuccess,failure:this._GetCenterLatLngFailure,scope:this,timeout:this.RequestTimeout,argument:{fn:D}};YAHOO.util.Connect.initHeader("If-Modified-Since","Sat, 1 Jan 2000 00:00:00 GMT");this.TransactionObjs.translate=YAHOO.util.Connect.asyncRequest("GET",E,G)}};this._GetCenterLatLngSuccess=function(H){var E;var D;var F=this._GetStatus(H);try{E=YAHOO.lang.JSON.parse(H.responseText);D={status:F.status,reason:F.reason,latitude:E[0].latitude,longitude:E[0].longitude}}catch(G){D={status:Pol.VI.Status.BadResponse.status,reason:Pol.VI.Status.BadResponse.reason}}H.argument.fn(D)};this._GetCenterLatLngFailure=function(E){var D=this._GetStatus(E);E.argument.fn(D)};this.Translate=function(G,F,D){if(this.IsViewActive()){var E="id="+this.UserId+"&type="+this.RequestType.Translate+"&table="+this.CurrentView.table+"&index="+this.CurrentView.index+"&points="+YAHOO.lang.JSON.stringify(G)+"&tt="+F;var H={success:this._TranslateSuccess,failure:this._TranslateFailure,scope:this,timeout:this.RequestTimeout,argument:{fn:D,tt:F}};YAHOO.util.Connect.initHeader("If-Modified-Since","Sat, 1 Jan 2000 00:00:00 GMT");YAHOO.util.Connect.asyncRequest("POST",this.ServerProxy,H,E)}};this._TranslateSuccess=function(H){var E;var D;var F=this._GetStatus(H);try{E=YAHOO.lang.JSON.parse(H.responseText);D={status:F.status,reason:F.reason,type:H.argument.tt,points:E}}catch(G){D={status:Pol.VI.Status.BadResponse.status,reason:Pol.VI.Status.BadResponses.reason}}H.argument.fn(D)};this._TranslateFailure=function(E){var D=this._GetStatus(E);E.argument.fn(D)};this.GetMetaData=function(D){if(this.IsViewActive()){var E=this.ServerProxy+"?id="+this.UserId+"&type="+this.RequestType.Metadata+"&table="+this.CurrentView.table+"&index="+this.CurrentView.index+"&x="+this.CurrentView.mx+"&y="+this.CurrentView.my;var F={success:this._GetMetaDataSuccess,failure:this._GetMetaDataFailure,scope:this,timeout:this.RequestTimeout,argument:{fn:D}};YAHOO.util.Connect.initHeader("If-Modified-Since","Sat, 1 Jan 2000 00:00:00 GMT");YAHOO.util.Connect.asyncRequest("GET",E,F)}};this._GetMetaDataSuccess=function(H){var E;var D;var F=this._GetStatus(H);try{E=YAHOO.lang.JSON.parse(H.responseText);D={status:F.status,reason:F.reason,latitude:E.latitude,longitude:E.longitude,altitude:E.altitude,elevation:E.elevation,declination:E.declination,bearing:E.bearing,roll:E.roll,camera:{latitude:E.camera.latitude,longitude:E.camera.longitude},ul:{latitude:E.ul.latitude,longitude:E.ul.longitude},ur:{latitude:E.ur.latitude,longitude:E.ur.longitude},lr:{latitude:E.lr.latitude,longitude:E.lr.longitude},ll:{latitude:E.ll.latitude,longitude:E.ll.longitude}}}catch(G){D={status:Pol.VI.Status.BadResponse.status,reason:Pol.VI.Status.BadResponse.reason}}H.argument.fn(D)};this._GetMetaDataFailure=function(E){var D=this._GetStatus(E);E.argument.fn(D)};this.GetImageData=function(F,D){if(this.IsViewActive()){var E=this.ServerProxy+"?id="+this.UserId+"&type="+this.RequestType.Metadata+"&table="+this.CurrentView.table+"&index="+this.CurrentView.index+"&points="+YAHOO.lang.JSON.stringify(F);var G={success:this._GetImageDataSuccess,failure:this._GetImageDataFailure,scope:this,timeout:this.RequestTimeout,argument:{fn:D}};YAHOO.util.Connect.initHeader("If-Modified-Since","Sat, 1 Jan 2000 00:00:00 GMT");YAHOO.util.Connect.asyncRequest("GET",E,G)}};this._GetImageDataSuccess=function(H){var E;var D;var F=this._GetStatus(H);try{E=YAHOO.lang.JSON.parse(H.responseText);D={status:F.status,reason:F.reason,path:E.path,pixels:E.pixels}}catch(G){D={status:Pol.VI.Status.BadResponse.status,reason:Pol.VI.Status.BadResponse.reason}}H.argument.fn(D)};this._GetImageDataFailure=function(E){var D=this._GetStatus(E);E.argument.fn(D)};this.GetLatLngBounds=function(E){if(this.IsViewActive()){var D=Math.round(this.viewer.dimensions.halfwidth/this.ScaleFactor);var H=Math.round(this.viewer.dimensions.halfheight/this.ScaleFactor);var G=[];var I=[];G.push(this.CurrentView.mx-D);G.push(this.CurrentView.mx+D);G.push(this.CurrentView.mx+D);G.push(this.CurrentView.mx-D);I.push(this.CurrentView.my-H);I.push(this.CurrentView.my-H);I.push(this.CurrentView.my+H);I.push(this.CurrentView.my+H);var F=this.ServerProxy+"?id="+this.UserId+"&type="+this.RequestType.Bounds+"&table="+this.CurrentView.table+"&index="+this.CurrentView.index+"&x="+this.CurrentView.mx+"&y="+this.CurrentView.my+"&xp="+G.toString()+"&yp="+I.toString();var J={success:this._GetLatLngBoundsSuccess,failure:this._GetLatLngBoundsFailure,scope:this,timeout:this.RequestTimeout,argument:{fn:E}};YAHOO.util.Connect.initHeader("If-Modified-Since","Sat, 1 Jan 2000 00:00:00 GMT");YAHOO.util.Connect.asyncRequest("GET",F,J)}};this._GetLatLngBoundsSuccess=function(H){var E;var D;var F=this._GetStatus(H);try{E=YAHOO.lang.JSON.parse(H.responseText);D={status:F.status,reason:F.reason,center:{latitude:E.center.latitude,longitude:E.center.longitude},ul:{latitude:E.ul.latitude,longitude:E.ul.longitude},ur:{latitude:E.ur.latitude,longitude:E.ur.longitude},lr:{latitude:E.lr.latitude,longitude:E.lr.longitude},ll:{latitude:E.ll.latitude,longitude:E.ll.longitude}}}catch(G){D={status:Pol.VI.Status.BadResponse.status,reason:Pol.VI.Status.BadResponse.reason}}H.argument.fn(D)};this._GetLatLngBoundsFailure=function(E){var D=this._GetStatus(E);E.argument.fn(D)};this.GetTileUrl=function(E,J){var G=null;var F;var D;if(this.IsViewActive()){if((E!=undefined)&&(J!=undefined)){F=E;D=J}else{F=this.CurrentView.mx;D=this.CurrentView.my}if((F<this.CurrentView.width)&&(D<this.CurrentView.height)&&(F>=0)&&(D>=0)){var I=Math.floor(F/this.TileSize);var H=Math.floor(D/this.TileSize);G=this._BuildTileUrl(this.CurrentView,I,H)}}return G};this._IsLatLonValid=function(G,E){var F=parseFloat(G);var D=parseFloat(E);if(isNaN(F)||isNaN(D)){return false}if((F<-90)||(F>90)){return false}if((D<-180)||(D>180)){return false}return true};this.SetEdgeLimit=function(D){if((D>=0)&&(D<=256)){this.EdgeLimit=D}};this.GetEdgeLimit=function(){return this.EdgeLimit};this.SetRequestTimeout=function(D){if(D>0){this.RequestTimeout=D}};this.GetRequestTimeout=function(){return this.RequestTimeout};this._EdgeDetect=function(K){if(K.AutoNavigate&&!K.Measuring){var E=K.CurrentView;var D=K.viewer.dimensions.halfwidth/K.ScaleFactor;var H=K.viewer.dimensions.halfheight/K.ScaleFactor;var G=((E.width-(E.mx+D))<=K.EdgeLimit)&&K.Xpos;var J=((E.mx-D)<=K.EdgeLimit)&&K.Xneg;var I=((E.my-H)<=K.EdgeLimit)&&K.Yneg;var F=((E.height-(E.my+H))<=K.EdgeLimit)&&K.Ypos;if(J||G||I||F){if(K.EdgeDetected){return}K.EdgeDetected=true;K.Events.onedgedetect.notify(Pol.VI.Status.OK)}else{K.EdgeDetected=false}}};this._GetStatus=function(E){var D;switch(E.status){case 200:D=Pol.VI.Status.OK;break;case 401:D=Pol.VI.Status.AuthorizationFailed;break;case 403:D=Pol.VI.Status.AccessDenied;break;case 404:D=Pol.VI.Status.NoImagesAvailable;break;case 421:D=Pol.VI.Status.UnknownRequest;break;case 424:D=Pol.VI.Status.IncompleteRequest;break;case 425:D=Pol.VI.Status.NoDataAvailable;break;case 430:D=Pol.VI.Status.DatabaseError;break;case 503:D=Pol.VI.Status.ServiceUnavailable;break;default:D=Pol.VI.Status.ServerError;break}if(E.argument){if(E.argument.data!=null){D.data=E.argument.data}}return D};this._InitOverlay=function(){this.viewer.overlay.shapes=[];this.viewer.overlay.events=[];this.viewer.overlay.mx=0;this.viewer.overlay.my=0;this.viewer.overlay.renderer=Pol.VI.GetRenderer();this.viewer.overlay.renderer.Init(this.viewer.overlay);this.AttachEvent("onviewchange",this._OverlayViewChange);this.AttachEvent("onscalechange",this._OverlayScaleChange);this.ContourCfg={visible:false,units:Pol.VI.DistanceUnits.Feet,points:[],annotations:{color:"#ffffff",spacing:10,text:[]},minor:{width:1,increment:10,color:"#c0c0c0",draw:null},major:{width:2,steps:5,color:"#708a90",draw:null}};this.SetContourLinesCfg()};this._UpdateOverlay=function(H,F,D,I){var G=Math.round(F*H.ScaleFactor);var E=Math.round(D*H.ScaleFactor);if(I){G*=-1;E*=-1}H.viewer.overlay.mx+=G;H.viewer.overlay.my+=E};this._PositionOverlay=function(H,D){var J=H.viewer.start;var G=H.viewer.dimensions;var I=H.viewer.overlay;if((D.x==0)&&(D.y==0)){I.mx=G.halfwidth;I.my=G.halfheight}var F=I.mx+(D.x-J.x);var E=I.my+(D.y-J.y);I.style.top=E+"px";I.style.left=F+"px"};this.SetExportOverlay=function(D){this.ExportOverlay=D};this.GetExportOverlay=function(){return this.ExportOverlay};this.Export=function(I,H,K){if(this.IsViewActive()&&(Math.abs(I.lr.x-I.ul.x)>0)&&(Math.abs(I.lr.y-I.ul.y)>0)){this.Statistics.exports++;if(arguments.length==2){var E={id:this.UserId,type:this.RequestType.Export,table:this.CurrentView.table,index:this.CurrentView.index,ulx:I.ul.x,uly:I.ul.y,lrx:I.lr.x,lry:I.lr.y,ts:this.TileSize,et:H.type,it:H.image?H.image:Pol.VI.ImageFormats.JPEG,op:H.options?H.options:0,hd:this.CurrentView.heading};if(this.ExportOverlay&&(H.type!=Pol.VI.ExportTypes.WorldFile)){if(this._IsShapeData()){E.shapes=this._GetShapeInfo()}}if(H.type==Pol.VI.ExportTypes.KML){var D={id:this.UserId,tb:this.CurrentView.table,ii:this.CurrentView.index,sx:I.ul.x,sy:I.ul.y,ex:I.lr.x,ey:I.lr.y,ts:this.TileSize,it:H.image?H.image:Pol.VI.ImageFormats.JPEG,op:H.options?H.options:0,hd:this.CurrentView.heading,ds:0};E.qs=YAHOO.lang.JSON.stringify(D)}this._ExportImageForm.action=this.ServerProxy;while(this._ExportImageForm.hasChildNodes()){this._ExportImageForm.removeChild(this._ExportImageForm.lastChild)}for(var J in E){var F;if(YAHOO.env.ua.ie){F=document.createElement('<input name="'+J+'" >')}else{F=document.createElement("input");F.name=J}F.type="hidden";F.value=E[J];this._ExportImageForm.appendChild(F)}this._ExportImageForm.submit()}else{if(arguments.length==3){var E={id:this.UserId,tb:this.CurrentView.table,ii:this.CurrentView.index,sx:I.ul.x,sy:I.ul.y,ex:I.lr.x,ey:I.lr.y,ts:this.TileSize,et:H.type,it:H.image?H.image:Pol.VI.ImageFormats.JPEG,op:H.options?H.options:0,hd:this.CurrentView.heading,ds:0};var G=this.ServerProxy+"?id="+this.UserId+"&type="+this.RequestType.Link+"&qs="+YAHOO.lang.JSON.stringify(E);var K={success:this._ExportLinkSuccess,failure:this._ExportLinkFailure,scope:this,timeout:this.RequestTimeout,argument:{fn:K}};YAHOO.util.Connect.initHeader("If-Modified-Since","Sat, 1 Jan 2000 00:00:00 GMT");YAHOO.util.Connect.asyncRequest("GET",G,K)}}}};this._ExportLinkSuccess=function(H){var E;var D;var F=this._GetStatus(H);try{E=YAHOO.lang.JSON.parse(H.responseText);D={status:F.status,reason:F.reason,url:E.url}}catch(G){D={status:Pol.VI.Status.BadResponse.status,reason:Pol.VI.Status.BadResponses.reason}}H.argument.fn(D)};this._ExportLinkFailure=function(E){var D=this._GetStatus(E);E.argument.fn(D)};this._InitExport=function(){this._ExportImageForm=document.createElement("form");this._ExportImageForm.method="post";this._ExportImageForm.style.visibility="hidden";this._ExportImageForm.style.position="absolute";document.body.appendChild(this._ExportImageForm);var D=YAHOO.util.Dom.generateId(this._ExportImageForm,"pol-vi-export");if(YAHOO.env.ua.ie){this._ExportImageIframe=document.createElement('<iframe name="'+D+'" />')}else{this._ExportImageIframe=document.createElement("iframe");this._ExportImageIframe.name=D}this._ExportImageIframe.src="javascript:false;";this._ExportImageIframe.style.visibility="hidden";this._ExportImageIframe.style.position="absolute";document.body.appendChild(this._ExportImageIframe);this._ExportImageForm.target=D};this.SetAccessControl=function(E,D){switch(E){case Pol.VI.AccessControl.Allow:case Pol.VI.AccessControl.Deny:this.AccessControlList[E]=D.split(",");break;default:break}};this.ResetAccessControl=function(D){switch(D){case Pol.VI.AccessControl.Allow:case Pol.VI.AccessControl.Deny:this.AccessControlList[D]=[];break;default:break}};this.AddGeoFence=function(H,F,G,D){var E=false;if((H<F)&&(G<D)){this.GeoFenceList.push({xmin:H,xmax:F,ymin:G,ymax:D});E=true}return E};this._IsWithinFence=function(G,E){var D=false;if(this.GeoFenceList.length>0){for(var F=0;F<this.GeoFenceList.length;F++){var H=this.GeoFenceList[F];if((G<=H.ymax)&&(G>=H.ymin)&&(E<=H.xmax)&&(E>=H.xmin)){D=true;break}}}else{D=true}return D};this._XmitStats=function(){var D=this.Statistics.views;if(D>0){var E=this.ServerProxy+"?id="+this.UserId+"&type="+this.RequestType.Statistics+"&v="+D;var F={scope:this,timeout:this.RequestTimeout};YAHOO.util.Connect.initHeader("If-Modified-Since","Sat, 1 Jan 2000 00:00:00 GMT");YAHOO.util.Connect.asyncRequest("GET",E,F)}this.Statistics.views-=D};this._InitStatistics=function(){var D=this;var E=function(){D._XmitStats()};this.StatisticsTimerId=window.setInterval(E,this.StatisticsInterval)};this._InitLogo=function(){var E=new Date();function D(){var H=navigator.userAgent.indexOf("MSIE ");if(H==-1){return false}var G=navigator.userAgent.substring(H+5);return(((G.indexOf("5.5")==0)||(G.indexOf("6")==0))&&(navigator.platform==("Win32")))}if(this.Logo){this.Logo.logodiv=null;this.Logo.destroy()}var F=document.createElement("div");YAHOO.util.Dom.generateId(F,"pol-vi-logo");F.className="pol-vi-logo";this.Logo=new YAHOO.widget.Overlay(F,{visible:true,zIndex:0});this.Logo.render(this.viewer.portal);YAHOO.util.Dom.setStyle(F,"zIndex",0);this.Logo.moveTo(YAHOO.util.Dom.getX(this.viewer)+5,YAHOO.util.Dom.getY(this.viewer)+this.viewer.offsetHeight-35);if(D()){YAHOO.util.Dom.setStyle(F,"filter","progid:DXImageTransform.Microsoft.AlphaImageLoader(src="+Pol.VI.ConfigParams.BaseUrl+"i/poweredby.png, sizingMethod='crop')")}else{YAHOO.util.Dom.setStyle(F,"background-image","url("+Pol.VI.ConfigParams.BaseUrl+"i/poweredby.png)")}this.Logo.logodiv=F;this.Logo.logodiv.innerHTML='<span class="pol-vi-logo-text">&#169; 2000-'+E.getFullYear()+this.LogoText+"</span>"};this._UpdateLogo=function(D){var E=new Date();this.LogoText=' <span class="pol-vi-logo-text-supplemental">'+D+"</span>";this.Logo.logodiv.innerHTML='<span class="pol-vi-logo-text">&#169; 2000-'+E.getFullYear()+this.LogoText+"</span>"};this.ConvertCoordinate=function(L,E,O){var D;var G;var J;var P;var I;var K;var N;var F;var Q;var H;var M=null;if(O==Pol.VI.CoordinateFormats.DegreeMinute){if(L>=0){D=1}else{D=-1}if(E>=0){G=1}else{G=-1}J=Math.floor(Math.abs(L));P=Math.floor(Math.abs(E));I=Math.abs(L)-J;K=Math.abs(E)-P;N=I*60;F=K*60;M={latitude:(D*J)+" "+(Math.round(N*100)/100),longitude:(G*P)+" "+(Math.round(F*100)/100)}}if(O==Pol.VI.CoordinateFormats.DegreeMinuteSecond){if(L>=0){D=1}else{D=-1}if(E>=0){G=1}else{G=-1}J=Math.floor(Math.abs(L));P=Math.floor(Math.abs(E));I=Math.abs(L)-J;K=Math.abs(E)-P;I*=60;K*=60;N=Math.floor(I);F=Math.floor(K);Q=((I-N)*60);H=((K-F)*60);M={latitude:(D*J)+" "+N+" "+(Math.round(Q*100)/100),longitude:(G*P)+" "+F+" "+(Math.round(H*100)/100)}}return M};this.ExportImage=function(E,D){this.Export(E,{type:Pol.VI.ExportTypes.Image,image:D})};this.ExportWorldFile=function(D){this.Export(D,{type:Pol.VI.ExportTypes.WorldFile})};this.GetLink=function(F,D,E){this.Export(F,{type:Pol.VI.ExportTypes.Image,image:E},D)}};Pol.VI.OverlayUtil={EventList:["onclick","ondblclick","onmousedown","onmouseup","onmouseover","onmouseout","oncontextmenu","onlocationchange"],IsValidShape:function(A){return(A instanceof Pol.VI.Marker||A instanceof Pol.VI.Element||A instanceof Pol.VI.Point||A instanceof Pol.VI.Polyline||A instanceof Pol.VI.Polygon||A instanceof Pol.VI.Circle||A instanceof Pol.VI.Text||A instanceof Pol.VI.Layer)},IsValidEvent:function(C){var B=false;for(var A=0;A<Pol.VI.OverlayUtil.EventList.length;A++){if(C===Pol.VI.OverlayUtil.EventList[A]){B=true;break}}return B},CreateCustomEvents:function(D){var C=[];for(var B=0;B<Pol.VI.OverlayUtil.EventList.length;B++){var A=Pol.VI.OverlayUtil.EventList[B];C[A]=new YAHOO.util.CustomEvent(A,D)}return C}};Pol.VI.OverlayShape={Marker:1,Element:2,Point:3,Polyline:4,Polygon:5,Circle:6,Text:7,Layer:8,Contour:9};Pol.VI.Pixel=function(A,B){this.x=parseInt(A);this.y=parseInt(B);this.Equals=function(D){var C=false;if(D instanceof Pol.VI.Pixel){C=((this.x==D.x)&&(this.y==D.y))}return C};this.toString=function(){return this.x+","+this.y}};Pol.VI.Size=function(B,A){this.width=parseInt(B);this.height=parseInt(A);this.Equals=function(D){var C=false;if(D instanceof Pol.VI.Size){C=((this.width==D.width)&&(this.height==D.height))}return C};this.toString=function(){return this.width+","+this.height}};Pol.VI.Icon=function(B,A){if(typeof B!="undefined"){if(B instanceof Pol.VI.Icon){this.image=B.image;this.iconSize=new Pol.VI.Size(B.iconSize.width,B.iconSize.height);this.iconAnchor=new Pol.VI.Pixel(B.iconAnchor.x,B.iconAnchor.y);if(typeof A!="undefined"){if(typeof A==="string"){this.image=A}}}}else{this.image=Pol.VI.ConfigParams.BaseUrl+"i/marker.png";this.iconSize=new Pol.VI.Size(20,34);this.iconAnchor=new Pol.VI.Pixel(10,34)}};Pol.VI.LatLng=function(B,A){this.lat=parseFloat(B);this.lng=parseFloat(A);this.precision=5e-7;this.SetLatLng=function(D,C){this.lat=parseFloat(D);this.lng=parseFloat(C)};this.Equals=function(E){var D=false;if(E instanceof Pol.VI.LatLng){var C=(Math.abs(this.lat-E.lat)<this.precision);var F=(Math.abs(this.lng-E.lng)<this.precision);D=C&&F}return D};this.DistanceTo=function(C){var D=NaN;if(C instanceof Pol.VI.LatLng){D=this._DistanceToHaversine(C)}return D};this.OverThere=function(C,I){var D=6371000;var H=this.toRad(this.lat);var F=this.toRad(this.lng);C=this.toRad(C);var G=Math.asin(Math.sin(H)*Math.cos(I/D)+Math.cos(H)*Math.sin(I/D)*Math.cos(C));var E=F+Math.atan2(Math.sin(C)*Math.sin(I/D)*Math.cos(H),Math.cos(I/D)-Math.sin(H)*Math.sin(G));E=(E+Math.PI)%(2*Math.PI)-Math.PI;if(isNaN(G)||isNaN(E)){return null}return new Pol.VI.LatLng(this.toDeg(G),this.toDeg(E))};this.BearingTo=function(E){var G=this.toRad(this.lat);var F=this.toRad(E.lat);var D=this.toRad(E.lng-this.lng);var H=Math.sin(D)*Math.cos(F);var C=Math.cos(G)*Math.sin(F)-Math.sin(G)*Math.cos(F)*Math.cos(D);return this.toBrng(Math.atan2(H,C))};this.Lat=function(){return this.lat};this.Lng=function(){return this.lng};this.toRad=function(C){return C*Math.PI/180};this.toDeg=function(C){return C*180/Math.PI};this.toString=function(){return this.lat+","+this.lng};this.toBrng=function(C){return(this.toDeg(C)+360)%360};this._DistanceToHaversine=function(G){var H=NaN;var F=6371000;var D=this.toRad(G.lat-this.lat);var E=this.toRad(G.lng-this.lng);var C=Math.sin(D/2)*Math.sin(D/2)+Math.cos(this.toRad(this.lat))*Math.cos(this.toRad(G.lat))*Math.sin(E/2)*Math.sin(E/2);var I=2*Math.atan2(Math.sqrt(C),Math.sqrt(1-C));H=F*I;return H}};Pol.VI.MarkerOptions=function(A){this.title=null,this.icon=null,this.draggable=null;if(typeof A!="undefined"){if(A.title){this.title=A.title}if(A.icon){this.icon=A.icon}if(A.draggable){this.draggable=A.draggable}}};Pol.VI.Marker=function(A,B){this.IsPNGandIE=function(D){if(D.toLowerCase().indexOf("png")==-1){return false}var E=navigator.userAgent.indexOf("MSIE ");if(E==-1){return false}var C=navigator.userAgent.substring(E+5);return(((C.indexOf("5.5")==0)||(C.indexOf("6")==0))&&(navigator.platform==("Win32")))};this.Events=Pol.VI.OverlayUtil.CreateCustomEvents(this);this.point=A;this.options=null;this.visible=true;this.x=0;this.y=0;this.navigator=null;this.cursor="default";this.draggable=false;this.icon=new Pol.VI.Icon();this.image=document.createElement("img");YAHOO.util.Dom.generateId(this.image,"marker");this.id=this.image.id;this.DD=new YAHOO.util.DD(this.image.id);this.DD.lock();if(typeof B!="undefined"){this.options=B;if(B.title){this.image.title=this.image.alt=B.title}if(B.icon){if(B.icon instanceof Pol.VI.Icon){this.icon=B.icon}}if(B.draggable){if(typeof B.draggable=="boolean"){this.draggable=B.draggable}}}if(this.IsPNGandIE(this.icon.image)){this.image.src=Pol.VI.ConfigParams.BaseUrl+"i/transparentpixel.gif";this.image.className="pol-vi-marker";this.image.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this.icon.image+"', sizingMethod='scale')"}else{this.image.src=this.icon.image;this.image.className="pol-vi-marker"}this.image.style.position="absolute";this.image.style.zIndex=1;this.image.style.width=this.icon.iconSize.width+"px";this.image.style.height=this.icon.iconSize.height+"px";this.IsVisible=function(){return this.visible};this.Show=function(){this.visible=true;this.image.style.visibility="visible"};this.Hide=function(){this.visible=false;this.image.style.visibility="hidden"};this.GetPoint=function(){return this.point};this.SetPoint=function(C){this.point=C};this.GetOptions=function(){return this.options};this.GetId=function(){return this.image.id};this.SetDraggable=function(C){if(this.navigator){this.DD.lock();this.DD.unsubscribe("mouseUpEvent",this._OnDDMouseEvent,this);this.DD.unsubscribe("mouseDownEvent",this._OnDDMouseEvent,this);this.DD.unsubscribe("endDragEvent",this._OnEndDrag,this);this.image.style.cursor=this.cursor;if(C){this.DD.subscribe("endDragEvent",this._OnEndDrag,this);this.DD.subscribe("mouseDownEvent",this._OnDDMouseEvent,this);this.DD.subscribe("mouseUpEvent",this._OnDDMouseEvent,this);this.DD.unlock();this.image.style.cursor="move"}}this.draggable=C};this.IsDraggable=function(){return this.draggable};this._DDtranslateCB=function(C){this.SetPoint(new Pol.VI.LatLng(C.points[0].latitude,C.points[0].longitude));this.DDevent.type="locationchange";this.DDevent.target=this;this.Events["on"+this.DDevent.type].notify(this.DDevent);this.DDevent=null};this._OnEndDrag=function(C,F){var E=Math.round(parseInt(F.image.style.top)/F.navigator.ScaleFactor);var D=Math.round(parseInt(F.image.style.left)/F.navigator.ScaleFactor);F.x=D+Math.round(F.icon.iconAnchor.x/F.navigator.ScaleFactor);F.y=E+Math.round(F.icon.iconAnchor.y/F.navigator.ScaleFactor);F.DDevent=F.navigator._GetEventInfo(C.e);F.navigator.Translate([F.x,F.y],Pol.VI.Translate.ImageToLocation,function(G){F._DDtranslateCB(G)})};this._OnDDMouseEvent=function(C,D){D.navigator._OnMouseEventHandler((C.e)?C.e:C,D.navigator)};this._AttachEvent=function(D,C){this.Events[D].subscribe(C,this);if(D!="onlocationchange"){this.cursor="pointer"}this.image.style.cursor=this.cursor};this._DetachEvent=function(D,C){this.Events[D].unsubscribe(C,this);this.cursor="default";this.image.style.cursor=this.cursor};this._EventHandler=function(C){this.Events["on"+C.type].notify(C)};this._Add=function(C){this.navigator=C;this.navigator.viewer.overlay.appendChild(this.image);if(this.IsDraggable()){this.SetDraggable(true)}};this._Remove=function(){this.SetDraggable(false);this.navigator.viewer.overlay.removeChild(this.image);this.navigator=null};this._SaveCoords=function(C){this.x=C[0];this.y=C[1]};this._Draw=function(D){if(this.visible){var E=Math.round(this.x*D);var C=Math.round(this.y*D);this.image.style.top=(C-this.icon.iconAnchor.y)+"px";this.image.style.left=(E-this.icon.iconAnchor.x)+"px";this.image.style.visibility="visible"}};this._Stringify=function(){return"["+Pol.VI.OverlayShape.Marker+","+this.point.lat+","+this.point.lng+"]"};this._Encode=function(){var C={st:Pol.VI.OverlayShape.Marker,lk:this.icon.image,cx:this.x,cy:this.y,ax:this.icon.iconAnchor.x,ay:this.icon.iconAnchor.y,iw:this.icon.iconSize.width,ih:this.icon.iconSize.height};return YAHOO.lang.JSON.stringify(C)}};Pol.VI.ElementOptions=function(A){this.id=null,this.size=null,this.className=null,this.innerHTML=null,this.zIndex=null,this.anchor=null;if(typeof A!="undefined"){if(A.id){this.id=A.id}if(A.size){this.size=A.size}if(A.className){this.className=A.className}if(A.innerHTML){this.innerHTML=A.innerHTML}if(A.zIndex){this.zIndex=A.zIndex}if(A.anchor){this.anchor=A.anchor}}};Pol.VI.Element=function(A,C){this.point=A;this.options=null;this.x=0;this.y=0;this.viewer=null;this.navigator=null;this.visible=true;this.cursor="default";this.Events=Pol.VI.OverlayUtil.CreateCustomEvents(this);this.Element=document.createElement("div");this.Element.style.position="absolute";this.Element.style.visibility="hidden";this.Element.style.zIndex=1;this.Element.size={width:0,height:0};this.Element.anchor={x:0,y:0};if(typeof C!="undefined"){this.options=C;if(C.size){var B=parseInt(C.size.width);var D=parseInt(C.size.height);this.Element.size=C.size;this.Element.style.width=B+"px";this.Element.style.height=D+"px";this.Element.anchor.x=Math.round(C.size.width/2);this.Element.anchor.y=Math.round(C.size.height/2)}if(C.className){this.Element.className=C.className}if(C.innerHTML){this.Element.innerHTML=C.innerHTML}if(C.zIndex){this.Element.stlye.zIndex=C.zIndex}if(C.anchor){this.Element.anchor=C.anchor}}YAHOO.util.Dom.generateId(this.Element,((C&&C.id)?C.id:"element"));this.id=this.Element.id;this.IsVisible=function(){return this.visible};this.Show=function(){this.visible=true;this.Element.style.visibility="visible"};this.Hide=function(){this.visible=false;this.Element.style.visibility="hidden"};this.GetPoint=function(){return this.point};this.SetPoint=function(E){this.point=E};this.GetOptions=function(){return this.options};this.SetOptions=function(F){if(typeof F!="undefined"){this.options=F;if(F.size){var E=parseInt(F.size.width);var G=parseInt(F.size.height);this.Element.size=F.size;this.Element.style.width=E+"px";this.Element.style.height=G+"px";this.Element.anchor.x=Math.round(F.size.width/2);this.Element.anchor.y=Math.round(F.size.height/2)}if(F.className){this.Element.className=F.className}if(F.innerHTML){this.Element.innerHTML=F.innerHTML}if(F.zIndex){this.Element.stlye.zIndex=F.zIndex}if(F.anchor){this.Element.anchor=F.anchor}this._Draw(this.navigator.ScaleFactor)}};this.GetId=function(){return this.Element.id};this._AttachEvent=function(F,E){this.Events[F].subscribe(E,this);this.Element.style.cursor="pointer"};this._DetachEvent=function(F,E){this.Events[F].unsubscribe(E,this);this.Element.style.cursor="default"};this._EventHandler=function(E){this.Events["on"+E.type].notify(E)};this._Add=function(E){this.viewer=E.viewer;this.navigator=E;this.viewer.overlay.appendChild(this.Element);this.Element.style.cursor=this.cursor};this._Remove=function(){this.viewer.overlay.removeChild(this.Element)};this._SaveCoords=function(E){this.x=E[0];this.y=E[1]};this._Draw=function(F){if(this.visible){var G=Math.round(this.x*F);var E=Math.round(this.y*F);this.Element.style.top=(E-this.Element.anchor.y)+"px";this.Element.style.left=(G-this.Element.anchor.x)+"px";this.Element.style.visibility="visible"}};this._Stringify=function(){return"["+Pol.VI.OverlayShape.Element+","+this.point.lat+","+this.point.lng+"]"};this._Encode=function(){var E={st:Pol.VI.OverlayShape.Element,cx:this.x,cy:this.y,ax:this.Element.anchor.x,ay:this.Element.anchor.y};return YAHOO.lang.JSON.stringify(E)}};Pol.VI.Point=function(A,D,C,B){this.point=A;this.visible=true;this.Events=Pol.VI.OverlayUtil.CreateCustomEvents(this);YAHOO.util.Dom.generateId(this,"point");this.xy=[];this.shape=null;this.renderer=null;this.strokeColor="#0000ff";this.strokeWeight=1;this.strokeOpacity=1;this.radius="5";this.cursor="default";if(typeof D!="undefined"){this.strokeColor=D}if(typeof C!="undefined"){if(typeof C=="string"){this.strokeWeight=parseInt(C)}else{this.strokeWeight=C}}if(typeof B!="undefined"){if(typeof B=="string"){this.strokeOpacity=parseFloat(B)}else{this.strokeOpacity=B}}this.IsVisible=function(){return this.visible};this.Show=function(){this.visible=true;this.renderer.SetAttributes(this.shape,{display:"block"})};this.Hide=function(){this.visible=false;this.renderer.SetAttributes(this.shape,{display:"none"})};this.GetId=function(){return this.id};this.SetStrokeColor=function(E){this.strokeColor=E;if(this.renderer!=null){this.renderer.SetAttributes(this.shape,{strokeColor:this.strokeColor});this.renderer.SetAttributes(this.shape,{fillColor:this.strokeColor})}};this.SetStrokeWeight=function(E){this.strokeWeight=E;if(this.renderer!=null){this.renderer.SetAttributes(this.shape,{strokeWeight:this.strokeWeight})}};this.SetStrokeOpacity=function(E){this.strokeOpacity=E;if(this.renderer!=null){this.renderer.SetAttributes(this.shape,{strokeOpacity:this.strokeOpacity});this.renderer.SetAttributes(this.shape,{fillOpacity:this.strokeOpacity})}};this.GetPoint=function(){return this.point};this.SetPoint=function(E){this.point=E};this._AttachEvent=function(F,E){this.Events[F].subscribe(E,this);this.cursor="pointer"};this._DetachEvent=function(F,E){this.Events[F].unsubscribe(E,this);this.cursor="default"};this._EventHandler=function(E){this.Events["on"+E.type].notify(E)};this._SaveCoords=function(E){this.xy[0]=E[0];this.xy[1]=E[1]};this._Add=function(E){this.renderer=E.viewer.overlay.renderer;this.shape=this.renderer.Create("circle",this.strokeColor,this.strokeWeight,this.strokeOpacity,this.strokeColor);this.shape.id=this.id;this.shape.style.cursor=this.cursor};this._Remove=function(){this.renderer.Remove(this.shape)};this._Draw=function(F){if(this.visible){var E=[];E[0]=Math.round(this.xy[0]*F);E[1]=Math.round(this.xy[1]*F);this.renderer.SetAttributes(this.shape,{center:E.join(","),radius:this.radius})}};this._Stringify=function(){return"["+Pol.VI.OverlayShape.Point+","+this.point.lat+","+this.point.lng+"]"};this._Encode=function(){var E={st:Pol.VI.OverlayShape.Point,sc:this.strokeColor,sw:this.strokeWeight,so:this.strokeOpacity,pr:parseInt(this.radius),sp:this.xy};return YAHOO.lang.JSON.stringify(E)}};Pol.VI.Polyline=function(C,D,B,A){this.points=C;this.visible=true;this.Events=Pol.VI.OverlayUtil.CreateCustomEvents(this);YAHOO.util.Dom.generateId(this,"polyline");this.xy=[];this.shape=null;this.navigator=null;this.renderer=null;this.cursor="default";this.strokeColor="#0000ff";this.strokeWeight=1;this.strokeOpacity=1;this.strokeLinecap="butt";this.strokeLinejoin="miter";if(typeof D!="undefined"){this.strokeColor=D}if(typeof B!="undefined"){if(typeof B=="string"){this.strokeWeight=parseInt(B)}else{this.strokeWeight=B}}if(typeof A!="undefined"){if(typeof A=="string"){this.strokeOpacity=parseFloat(A)}else{this.strokeOpacity=A}}this.IsVisible=function(){return this.visible};this.Show=function(){this.visible=true;this.renderer.SetAttributes(this.shape,{display:"block"})};this.Hide=function(){this.visible=false;this.renderer.SetAttributes(this.shape,{display:"none"})};this.GetId=function(){return this.id};this.SetStrokeColor=function(E){this.strokeColor=E;if(this.renderer!=null){this.renderer.SetAttributes(this.shape,{strokeColor:this.strokeColor})}};this.SetStrokeWeight=function(E){this.strokeWeight=E;if(this.renderer!=null){this.renderer.SetAttributes(this.shape,{strokeWeight:this.strokeWeight})}};this.SetStrokeOpacity=function(E){this.strokeOpacity=E;if(this.renderer!=null){this.renderer.SetAttributes(this.shape,{strokeOpacity:this.strokeOpacity})}};this.SetLinecap=function(E){this.strokeLinecap=E;if(this.renderer!=null){this.renderer.SetAttributes(this.shape,{strokeLinecap:this.strokeLinecap})}};this.SetLinejoin=function(E){this.strokeLinejoin=E;if(this.renderer!=null){this.renderer.SetAttributes(this.shape,{strokeLinejoin:this.strokeLinejoin})}};this.GetPoints=function(){return this.points};this.SetPoints=function(E){this.points=E};this.GetDistance=function(F,E){this.navigator._Compute(this._Stringify(),Pol.VI.ImageTools.Distance,F,E)};this._AttachEvent=function(F,E){this.Events[F].subscribe(E,this);this.cursor="pointer"};this._DetachEvent=function(F,E){this.Events[F].unsubscribe(E,this);this.cursor="default"};this._EventHandler=function(E){this.Events["on"+E.type].notify(E)};this._SaveCoords=function(F){for(var E=0;E<F.length;E++){this.xy[E]=F[E]}};this._Add=function(E){this.navigator=E;this.renderer=E.viewer.overlay.renderer;this.shape=this.renderer.Create("polyline",this.strokeColor,this.strokeWeight,this.strokeOpacity);this.renderer.SetAttributes(this.shape,{strokeLinecap:this.strokeLinecap});this.renderer.SetAttributes(this.shape,{strokeLinejoin:this.strokeLinejoin});this.shape.id=this.id;this.shape.style.cursor=this.cursor};this._Remove=function(){this.renderer.Remove(this.shape)};this._Draw=function(G){if(this.visible){var F=[];for(var E=0;E<this.xy.length;E++){F[E]=Math.round(this.xy[E]*G)}this.renderer.SetAttributes(this.shape,{points:F.join(",")})}};this._Stringify=function(){var E=[];for(var F=0;F<this.points.length;F++){E.push(this.points[F].lat+","+this.points[F].lng)}return"["+Pol.VI.OverlayShape.Polyline+","+E.join(",")+"]"};this._Encode=function(){var E={st:Pol.VI.OverlayShape.Polyline,sc:this.strokeColor,sw:this.strokeWeight,so:this.strokeOpacity,sp:this.xy};return YAHOO.lang.JSON.stringify(E)}};Pol.VI.Polygon=function(D,E,C,B,F,A){this.points=D;if(this.points.length>0){if(this.points[0]instanceof Array){this.OuterRing=this.points[0];this.InnerRing=this.points.slice(1)}else{this.OuterRing=this.points;this.InnerRing=[]}}else{this.OuterRing=[];this.InnerRing=[]}this.visible=true;this.Events=Pol.VI.OverlayUtil.CreateCustomEvents(this);YAHOO.util.Dom.generateId(this,"polygon");this.xy=[];this.shape=null;this.navigator=null;this.renderer=null;this.strokeColor="#0000ff";this.strokeWeight=1;this.strokeOpacity=1;this.fill=false;this.fillColor="#000000";this.fillOpacity=1;this.cursor="default";if(typeof E!="undefined"){this.strokeColor=E}if(typeof C!="undefined"){if(typeof C=="string"){this.strokeWeight=parseInt(C)}else{this.strokeWeight=C}}if(typeof B!="undefined"){if(typeof B=="string"){this.strokeOpacity=parseFloat(B)}else{this.strokeOpacity=B}}if(typeof F!="undefined"){this.fill=true;this.fillColor=F}if(typeof A!="undefined"){if(typeof A=="string"){this.fillOpacity=parseFloat(A)}else{this.fillOpacity=A}}this._IsFillPolygon=function(){return this.fill};this.IsVisible=function(){return this.visible};this.Show=function(){this.visible=true;this.renderer.SetAttributes(this.shape,{display:"block"})};this.Hide=function(){this.visible=false;this.renderer.SetAttributes(this.shape,{display:"none"})};this.GetId=function(){return this.id};this.SetStrokeColor=function(G){this.strokeColor=G;if(this.renderer!=null){this.renderer.SetAttributes(this.shape,{strokeColor:this.strokeColor})}};this.SetStrokeWeight=function(G){this.strokeWeight=G;if(this.renderer!=null){this.renderer.SetAttributes(this.shape,{strokeWeight:this.strokeWeight})}};this.SetStrokeOpacity=function(G){this.strokeOpacity=G;if(this.renderer!=null){this.renderer.SetAttributes(this.shape,{strokeOpacity:this.strokeOpacity})}};this.SetFillColor=function(G){this.fillColor=G;if(this.renderer!=null){this.renderer.SetAttributes(this.shape,{fillColor:this.fillColor})}};this.SetFillOpacity=function(G){this.fillOpacity=G;if(this.renderer!=null){this.renderer.SetAttributes(this.shape,{fillOpacity:this.fillOpacity})}};this.GetPoints=function(){return this.points};this.SetPoints=function(G){this.points=G;if(this.points.length>0){if(this.points[0]instanceof Array){this.OuterRing=this.points[0];this.InnerRing=this.points.slice(1)}else{this.OuterRing=this.points;this.InnerRing=[]}}else{this.OuterRing=[];this.InnerRing=[]}};this.GetArea=function(H,G){this.navigator._Compute(this._Stringify(),Pol.VI.ImageTools.Area,H,G)};this.GetDistance=function(H,G){this.navigator._Compute(this._Stringify(),Pol.VI.ImageTools.Distance,H,G)};this._AttachEvent=function(H,G){this.Events[H].subscribe(G,this);this.cursor="pointer"};this._DetachEvent=function(H,G){this.Events[H].unsubscribe(G,this);this.cursor="default"};this._EventHandler=function(G){this.Events["on"+G.type].notify(G)};this._SaveCoords=function(H){for(var G=0;G<H.length;G++){this.xy[G]=H[G]}};this._Add=function(G){this.navigator=G;this.renderer=G.viewer.overlay.renderer;if(this.fill){this.shape=this.renderer.Create("path",this.strokeColor,this.strokeWeight,this.strokeOpacity,this.fillColor,this.fillOpacity);this.renderer.SetAttributes(this.shape,{fillRule:"evenodd"})}else{this.shape=this.renderer.Create("path",this.strokeColor,this.strokeWeight,this.strokeOpacity)}this.shape.id=this.id;this.shape.style.cursor=this.cursor};this._Remove=function(){this.renderer.Remove(this.shape)};this._Draw=function(M){if(this.visible){var L=[];var H;var G=this.OuterRing.length*2;for(var I=0;I<this.xy.length;I++){L[I]=Math.round(this.xy[I]*M)}H=this.shape.moveto+L[0]+" "+L[1]+this.shape.lineto+L.slice(2,G).join(" ")+this.shape.closepath;for(var I=0,J=G;I<this.InnerRing.length;I++){var K=this.InnerRing[I].length*2;H+=this.shape.moveto+L[J]+" "+L[J+1]+this.shape.lineto+L.slice(J+2,J+K).join(" ")+this.shape.closepath;J+=K}H+=this.shape.endpath;this.renderer.SetAttributes(this.shape,{d:H})}};this._Stringify=function(){var G=[];for(var I=0;I<this.OuterRing.length;I++){G.push(this.OuterRing[I].lat+","+this.OuterRing[I].lng)}for(var I=0;I<this.InnerRing.length;I++){for(var H=0;H<this.InnerRing[I].length;H++){G.push(this.InnerRing[I][H].lat+","+this.InnerRing[I][H].lng)}}return"["+Pol.VI.OverlayShape.Polygon+","+G.join(",")+"]"};this._Encode=function(){var J;var K;if(this.InnerRing.length>0){var M=this.OuterRing.length*2;J=this.xy.slice(0,M);J.push(this.xy[0],this.xy[1]);K=[this.OuterRing.length];for(var H=0,I=M;H<this.InnerRing.length;H++){var L=this.InnerRing[H].length*2;J=J.concat(this.xy.slice(I,I+L));J.push(this.xy[I],this.xy[I+1]);I+=L;K.push(this.InnerRing[H].length)}}else{J=this.xy.slice(0);K=[this.OuterRing.length]}var G={st:Pol.VI.OverlayShape.Polygon,sc:this.strokeColor,sw:this.strokeWeight,so:this.strokeOpacity,fi:this.fill,fc:this.fillColor,fo:this.fillOpacity,sp:J,nr:K};return YAHOO.lang.JSON.stringify(G)}};Pol.VI.Circle=function(D,E,C,B,F,A){this.points=D;this.visible=true;this.Events=Pol.VI.OverlayUtil.CreateCustomEvents(this);YAHOO.util.Dom.generateId(this,"circle");this.xy=[];this.shape=null;this.navigator=null;this.renderer=null;this.strokeColor="#0000ff";this.strokeWeight=1;this.strokeOpacity=1;this.fill=false;this.fillColor="#000000";this.fillOpacity=1;this.cursor="default";if(typeof E!="undefined"){this.strokeColor=E}if(typeof C!="undefined"){if(typeof C=="string"){this.strokeWeight=parseInt(C)}else{this.strokeWeight=C}}if(typeof B!="undefined"){if(typeof B=="string"){this.strokeOpacity=parseFloat(B)}else{this.strokeOpacity=B}}if(typeof F!="undefined"){this.fill=true;this.fillColor=F}if(typeof A!="undefined"){if(typeof A=="string"){this.fillOpacity=parseFloat(A)}else{this.fillOpacity=A}}this.IsVisible=function(){return this.visible};this.Show=function(){this.visible=true;this.renderer.SetAttributes(this.shape,{display:"block"})};this.Hide=function(){this.visible=false;this.renderer.SetAttributes(this.shape,{display:"none"})};this.GetId=function(){return this.id};this.SetStrokeColor=function(G){this.strokeColor=G;if(this.renderer!=null){this.renderer.SetAttributes(this.shape,{strokeColor:this.strokeColor})}};this.SetStrokeWeight=function(G){this.strokeWeight=G;if(this.renderer!=null){this.renderer.SetAttributes(this.shape,{strokeWeight:this.strokeWeight})}};this.SetStrokeOpacity=function(G){this.strokeOpacity=G;if(this.renderer!=null){this.renderer.SetAttributes(this.shape,{strokeOpacity:this.strokeOpacity})}};this.SetFillColor=function(G){this.fillColor=G;if(this.renderer!=null){this.renderer.SetAttributes(this.shape,{fillColor:this.fillColor})}};this.SetFillOpacity=function(G){this.fillOpacity=G;if(this.renderer!=null){this.renderer.SetAttributes(this.shape,{fillOpacity:this.fillOpacity})}};this.GetPoints=function(){return this.points};this.SetPoints=function(G){this.points=G};this.GetArea=function(H,G){this.navigator._Compute(this._Stringify(),Pol.VI.ImageTools.Area,H,G)};this.GetDistance=function(H,G){this.navigator._Compute(this._Stringify(),Pol.VI.ImageTools.Distance,H,G)};this._AttachEvent=function(H,G){this.Events[H].subscribe(G,this);this.cursor="pointer"};this._DetachEvent=function(H,G){this.Events[H].unsubscribe(G,this);this.cursor="default"};this._EventHandler=function(G){this.Events["on"+G.type].notify(G)};this._SaveCoords=function(H){for(var G=0;G<H.length;G++){this.xy[G]=H[G]}};this._Add=function(G){this.navigator=G;this.renderer=G.viewer.overlay.renderer;if(this.fill){this.shape=this.renderer.Create("ellipse",this.strokeColor,this.strokeWeight,this.strokeOpacity,this.fillColor,this.fillOpacity)}else{this.shape=this.renderer.Create("ellipse",this.strokeColor,this.strokeWeight,this.strokeOpacity)}this.shape.id=this.id;this.shape.style.cursor=this.cursor};this._Remove=function(){this.renderer.Remove(this.shape)};this._Draw=function(L){if(this.visible){var K=[];var J;for(J=0;J<this.xy.length;J++){K[J]=Math.round(this.xy[J]*L)}var G=K[0];var N=K[1];var H=K.slice(2);var I=Math.abs(H[0]-G);var M=Math.abs(H[1]-N);for(J=2;J<H.length;J+=2){I=Math.max(Math.abs(H[J]-G),I);M=Math.max(Math.abs(H[J+1]-N),M)}this.renderer.SetAttributes(this.shape,{center:G+","+N,radius:I+","+M})}};this._Stringify=function(){if(this.points.radius.distance){return"["+Pol.VI.OverlayShape.Circle+","+this.points.center.lat+","+this.points.center.lng+","+this.points.radius.distance+","+this.points.radius.unit+","+0+"]"}else{return"["+Pol.VI.OverlayShape.Circle+","+this.points.center.lat+","+this.points.center.lng+","+this.points.radius.lat+","+this.points.radius.lng+","+1+"]"}};this._Encode=function(){var G={st:Pol.VI.OverlayShape.Circle,sc:this.strokeColor,sw:this.strokeWeight,so:this.strokeOpacity,fc:this.fillColor,fo:this.fillOpacity,sp:this.xy};return YAHOO.lang.JSON.stringify(G)}};Pol.VI.Text=function(B,D,A,F,C,G,E){this.point=B;this.visible=true;this.Events=Pol.VI.OverlayUtil.CreateCustomEvents(this);YAHOO.util.Dom.generateId(this,"text");this.text=null;this.xy=[];this.shape=null;this.renderer=null;this.color="#0000ff";this.fontFamily="Verdana";this.fontSize="12px";this.fontWeight="normal";this.fontStyle="normal";this.opacity=1;this.anchor="middle";this.cursor="default";if(typeof D!="undefined"){this.color=D}if(typeof A!="undefined"){this.fontFamily=A}if(typeof F!="undefined"){this.fontSize=F}if(typeof C!="undefined"){this.fontWeight=C}if(typeof G!="undefined"){this.fontStyle=G}if(typeof E!="undefined"){if(typeof E=="string"){this.opacity=parseFloat(E)}else{this.opacity=E}}this.SetColor=function(H){this.color=H;if(this.renderer!=null){this.renderer.SetAttributes(this.shape,{fillColor:this.color});this.renderer.SetAttributes(this.shape,{textColor:this.color})}};this.SetFontFamily=function(H){this.fontFamily=H;if(this.renderer!=null){this.renderer.SetAttributes(this.shape,{fontFamily:this.fontFamily})}};this.SetFontSize=function(H){this.fontSize=H;if(this.renderer!=null){this.renderer.SetAttributes(this.shape,{fontSize:this.fontSize})}};this.SetFontWeight=function(H){this.fontWeight=H;if(this.renderer!=null){this.renderer.SetAttributes(this.shape,{fontWeight:this.fontWeight})}};this.SetFontStyle=function(H){this.fontStyle=H;if(this.renderer!=null){this.renderer.SetAttributes(this.shape,{fontStyle:this.fontStyle})}};this.SetOpacity=function(H){this.opacity=H;if(this.renderer!=null){this.renderer.SetAttributes(this.shape,{fillOpacity:this.opacity});this.renderer.SetAttributes(this.shape,{textOpacity:this.opacity})}};this.SetAnchor=function(H){this.anchor=H;if(this.renderer!=null){this.renderer.SetAttributes(this.shape,{textAnchor:this.anchor})}};this.AddText=function(H){this.text=H;if(this.renderer!=null){this.renderer.SetAttributes(this.shape,{text:this.text})}};this.GetText=function(){return this.text};this.IsVisible=function(){return this.visible};this.Show=function(){this.visible=true;this.renderer.SetAttributes(this.shape,{display:"block"})};this.Hide=function(){this.visible=false;this.renderer.SetAttributes(this.shape,{display:"none"})};this.GetId=function(){return this.id};this.GetPoint=function(){return this.point};this.SetPoint=function(H){this.point=H};this._AttachEvent=function(I,H){this.Events[I].subscribe(H,this);this.cursor="pointer"};this._DetachEvent=function(I,H){this.Events[I].unsubscribe(H,this);this.cursor="default"};this._EventHandler=function(H){this.Events["on"+H.type].notify(H)};this._SaveCoords=function(H){this.xy[0]=H[0];this.xy[1]=H[1]};this._Add=function(H){this.renderer=H.viewer.overlay.renderer;this.shape=this.renderer.Create("text","none","1","1.0",this.color,this.opacity);this.renderer.SetAttributes(this.shape,{text:this.text,fontFamily:this.fontFamily,fontSize:this.fontSize,fontWeight:this.fontWeight,fontStyle:this.fontStyle,textColor:this.color,textOpacity:this.opacity,textAnchor:this.anchor});this.shape.id=this.id;this.shape.style.cursor=this.cursor};this._Remove=function(){this.renderer.Remove(this.shape)};this._Draw=function(I){if(this.visible){var H=[];H[0]=Math.round(this.xy[0]*I);H[1]=Math.round(this.xy[1]*I);this.renderer.SetAttributes(this.shape,{x:H[0],y:H[1]})}};this._Stringify=function(){return"["+Pol.VI.OverlayShape.Text+","+this.point.lat+","+this.point.lng+"]"};this._Encode=function(){var H={st:Pol.VI.OverlayShape.Text,fc:this.color,ff:this.fontFamily,fs:this.fontSize,fw:this.fontWeight,fy:this.fontStyle,fo:this.opacity,ac:this.anchor,tx:this.text,sp:this.xy};return YAHOO.lang.JSON.stringify(H)}};Pol.VI.Layer=function(D,C,B,E,A){this.shapes=[];this.visible=true;this.Events=Pol.VI.OverlayUtil.CreateCustomEvents(this);YAHOO.util.Dom.generateId(this,"layer");this.sid=0;this.xy=[];this.DrawPolygons=null;this.DrawPolylines=null;this.DrawPoints=null;this.renderer=null;this.navigator=null;this.PolygonAttr={strokeColor:"#0000ff",strokeWeight:1,strokeOpacity:1,fill:false,fillColor:"#000000",fillOpacity:1};this.PolylineAttr={strokeColor:"#0000ff",strokeWeight:1,strokeOpacity:1,fill:false,fillColor:"#000000",fillOpacity:1};this.PointAttr={strokeColor:"#0000ff",strokeWeight:1,strokeOpacity:1,fill:false,fillColor:"#000000",fillOpacity:1};this.cursor="default";if(typeof D!="undefined"){this.PolygonAttr.strokeColor=this.PolylineAttr.strokeColor=this.PointAttr.strokeColor=D}if(typeof C!="undefined"){if(typeof C=="string"){this.PolygonAttr.strokeWeight=this.PolylineAttr.strokeWeight=this.PointAttr.strokeWeight=parseInt(C)}else{this.PolygonAttr.strokeWeight=this.PolylineAttr.strokeWeight=this.PointAttr.strokeWeight=C}}if(typeof B!="undefined"){if(typeof B=="string"){this.PolygonAttr.strokeOpacity=this.PolylineAttr.strokeOpacity=this.PointAttr.strokeOpacity=parseFloat(B)}else{this.PolygonAttr.strokeOpacity=this.PolylineAttr.strokeOpacity=this.PointAttr.strokeOpacity=B}}if(typeof E!="undefined"){this.PolygonAttr.fill=this.PolylineAttr.fill=this.PointAttr.fill=true;this.PolygonAttr.fillColor=this.PolylineAttr.fillColor=this.PointAttr.fillColor=E}if(typeof A!="undefined"){if(typeof A=="string"){this.PolygonAttr.fillOpacity=this.PolylineAttr.fillOpacity=this.PointAttr.fillOpacity=parseFloat(A)}else{this.PolygonAttr.fillOpacity=this.PolylineAttr.fillOpacity=this.PointAttr.fillOpacity=A}}this.IsVisible=function(){return this.visible};this.Show=function(){this.visible=true;this.renderer.SetAttributes(this.DrawPolygons,{display:"block"});this.renderer.SetAttributes(this.DrawPolylines,{display:"block"});this.renderer.SetAttributes(this.DrawPoints,{display:"block"})};this.Hide=function(){this.visible=false;this.renderer.SetAttributes(this.DrawPolygons,{display:"none"});this.renderer.SetAttributes(this.DrawPolylines,{display:"none"});this.renderer.SetAttributes(this.DrawPoints,{display:"none"})};this.GetId=function(){return this.id};this.GetNumShapes=function(){return this.shapes.length};this.SetStrokeColor=function(G,H){var F=this._GetDrawTool(G);if((this.renderer!=null)&&(F!=null)){F.attr.strokeColor=H;this.renderer.SetAttributes(F,{strokeColor:H})}};this.SetStrokeWeight=function(H,G){var F=this._GetDrawTool(H);if((this.renderer!=null)&&(F!=null)){F.attr.strokeWeight=G;this.renderer.SetAttributes(F,{strokeWeight:G})}};this.SetStrokeOpacity=function(H,G){var F=this._GetDrawTool(H);if((this.renderer!=null)&&(F!=null)){F.attr.strokeOpacity=G;this.renderer.SetAttributes(F,{strokeOpacity:G})}};this.SetFillColor=function(G,H){var F=this._GetDrawTool(G);if((this.renderer!=null)&&(F!=null)){F.attr.fillColor=H;this.renderer.SetAttributes(F,{fillColor:H})}};this.SetFillOpacity=function(H,F){var G=this._GetDrawTool(H);if((this.renderer!=null)&&(G!=null)){G.attr.fillOpacity=F;this.renderer.SetAttributes(G,{fillOpacity:F})}};this.SetLinecap=function(H,G){var F=this._GetDrawTool(H);if((this.renderer!=null)&&(F!=null)){F.attr.strokeLinecap=G;this.renderer.SetAttributes(F,{strokeLinecap:G})}};this.SetLinejoin=function(H,G){var F=this._GetDrawTool(H);if((this.renderer!=null)&&(F!=null)){F.attr.strokeLinejoin=G;this.renderer.SetAttributes(F,{strokeLinejoin:G})}};this.AddShape=function(G,F){var I=this.id+"#"+this.sid++;var H=F.slice(0);H.id=I;H.type=G;H.visible=true;this.shapes.push(H);return I};this.RemoveShape=function(H){var G=false;for(var F=0;F<this.shapes.length;F++){if(this.shapes[F].id===H){this.shapes.splice(F,1);G=true;break}}return G};this.ShowShape=function(G){for(var F=0;F<this.shapes.length;F++){if(this.shapes[F].id===G){this.shapes[F].visible=true;break}}this._Draw(this.navigator.ScaleFactor)};this.HideShape=function(G){for(var F=0;F<this.shapes.length;F++){if(this.shapes[F].id===G){this.shapes[F].visible=false;break}}this._Draw(this.navigator.ScaleFactor)};this.GetArea=function(M,K,F){var J=null;for(var I=0;I<this.shapes.length;I++){if((this.shapes[I].id===M)&&(this.shapes[I].type==Pol.VI.OverlayShape.Polygon)){var G=[];var L=this.shapes[I];for(var H=0;H<L.length;H++){G.push(L[H].lat+","+L[H].lng)}J="["+L.type+","+G.join(",")+"]"}}if(J){this.navigator._Compute(J,Pol.VI.ImageTools.Area,K,F)}};this.GetDistance=function(M,K,F){var J=null;for(var I=0;I<this.shapes.length;I++){if((this.shapes[I].id===M)&&((this.shapes[I].type==Pol.VI.OverlayShape.Polygon)||(this.shapes[I].type==Pol.VI.OverlayShape.Polyline))){var G=[];var L=this.shapes[I];for(var H=0;H<L.length;H++){G.push(L[H].lat+","+L[H].lng)}J="["+L.type+","+G.join(",")+"]"}}if(J){this.navigator._Compute(J,Pol.VI.ImageTools.Distance,K,F)}};this.GetShapeId=function(F,M){var J=null;var L=0;for(var H=0,K=0,G=0;((H<this.shapes.length)&&(J==null));H++){var I;G=this.shapes[H].length*2;I=this.xy.slice(K,K+G);if(this.shapes[H].visible){switch(this.shapes[H].type){case Pol.VI.OverlayShape.Polygon:if(this._IsWithinPolygon(I,F,M)){J=this.shapes[H].id}break;case Pol.VI.OverlayShape.Polyline:L=parseInt(this.PolylineAttr.strokeWeight)*0.5;if(this._IsOnPolyline(I,F,M,L)){J=this.shapes[H].id}break;case Pol.VI.OverlayShape.Point:L=4;if(this._IsOnPoint(I,F,M,L)){J=this.shapes[H].id}break;default:break}}K+=G}return J};this._AttachEvent=function(G,F){this.Events[G].subscribe(F,this);this.cursor="pointer"};this._DetachEvent=function(G,F){this.Events[G].unsubscribe(F,this);this.cursor="default"};this._EventHandler=function(F){this.Events["on"+F.type].notify(F)};this._GetDrawTool=function(G){var F=null;switch(G){case Pol.VI.OverlayShape.Polygon:F=this.DrawPolygons;break;case Pol.VI.OverlayShape.Polyline:F=this.DrawPolylines;break;case Pol.VI.OverlayShape.Point:F=this.DrawPoints;break;default:break}return F};this._IsWithinPolygon=function(K,G,L){var F=false;var J=K.length;for(var I=0;I<J;I+=2){var H=(I+2)%J;if((((K[I+1]<=L)&&(L<K[H+1]))||((K[H+1]<=L)&&(L<K[I+1])))&&(G<(K[H]-K[I])*(L-K[I+1])/(K[H+1]-K[I+1])+K[I])){F=!F}}return F};this._IsOnPolyline=function(H,T,S,G){for(var N=0;N<H.length;N+=2){var M=H[N];var F=H[N+1];var U=H[N+2];var Q=H[N+3];if((M==U)&&(F==Q)){if((Math.abs(M-T)<=G)&&(Math.abs(F-S)<=G)){return true}else{return false}}if(M==U){if((T<M-G)||(T>M+G)){return false}if((Q>F)&&(S<=Q)&&(S>=F)){return true}else{if((S<=F)&&(S>=Q)){return true}else{return false}}}if(F==Q){if((S<F-G)||(S>F+G)){return false}if((U>M)&&(T<=U)&&(T>=M)){return true}else{if((T<=M)&&(T>=U)){return true}else{return false}}}var J=(Q-F)/(U-M);var R=F-(J*M);var P=S-(J*T)-R;P=P*Math.cos(Math.atan(-J));if(P<0){P=-P}if(P<=G){J=-1/J;var O=(M+U)/2;var K=(F+Q)/2;R=K-(J*O);var I=Q-(J*U)-R;var L=I*-1;if(L>I){I=L}P=S-(J*T)-R;if(P<0){P=-P}if(P<=I){return true}}}return false};this._IsOnPoint=function(H,F,K,J){var G=H[0];var I=H[1];if((Math.abs(G-F)<=J)&&(Math.abs(I-K)<=J)){return true}else{return false}};this._SaveCoords=function(G){for(var F=0;F<G.length;F++){this.xy[F]=G[F]}};this._Add=function(F){this.navigator=F;this.renderer=F.viewer.overlay.renderer;if(this.PolygonAttr.fill){this.DrawPolygons=this.renderer.Create("path",this.PolygonAttr.strokeColor,this.PolygonAttr.strokeWeight,this.PolygonAttr.strokeOpacity,this.PolygonAttr.fillColor,this.PolygonAttr.fillOpacity)}else{this.DrawPolygons=this.renderer.Create("path",this.PolygonAttr.strokeColor,this.PolygonAttr.strokeWeight,this.PolygonAttr.strokeOpacity)}this.DrawPolylines=this.renderer.Create("path",this.PolylineAttr.strokeColor,this.PolylineAttr.strokeWeight,this.PolylineAttr.strokeOpacity);this.DrawPoints=this.renderer.Create("path",this.PointAttr.strokeColor,this.PointAttr.strokeWeight,this.PointAttr.strokeOpacity);this.renderer.SetAttributes(this.DrawPoints,{strokeWeight:"8px"});this.renderer.SetAttributes(this.DrawPoints,{strokeLinecap:"round"});this.renderer.SetAttributes(this.DrawPoints,{strokeLinejoin:"round"});this.DrawPolygons.id=this.id;this.DrawPolylines.id=this.id;this.DrawPoints.id=this.id;this.DrawPolygons.attr=this.PolygonAttr;this.DrawPolylines.attr=this.PolylineAttr;this.DrawPoints.attr=this.PointAttr;this.DrawPolygons.style.cursor=this.cursor;this.DrawPolylines.style.cursor=this.cursor;this.DrawPoints.style.cursor=this.cursor};this._Remove=function(){this.renderer.Remove(this.DrawPolygons);this.renderer.Remove(this.DrawPolylines);this.renderer.Remove(this.DrawPoints)};this._Draw=function(H){if(this.visible){var O=[];var F="";var M="";var L="";for(var K=0;K<this.xy.length;K++){O[K]=Math.round(this.xy[K]*H)}for(var J=0,G=0,I=0;J<this.shapes.length;J++){var N;I=this.shapes[J].length*2;N=O.slice(G,G+I);if(this.shapes[J].visible){switch(this.shapes[J].type){case Pol.VI.OverlayShape.Polygon:F+=this.DrawPolygons.moveto+N[0]+" "+N[1]+this.DrawPolygons.lineto+N.slice(2).join(" ")+this.DrawPolygons.closepath;break;case Pol.VI.OverlayShape.Polyline:M+=this.DrawPolylines.moveto+N[0]+" "+N[1]+this.DrawPolylines.lineto+N.slice(2).join(" ");break;case Pol.VI.OverlayShape.Point:L+=this.DrawPoints.moveto+N[0]+" "+N[1]+this.DrawPoints.lineto+N[0]+" "+(N[1]-1)+this.DrawPoints.lineto+N[0]+" "+(N[1]+1)+this.DrawPoints.lineto+(N[0]+1)+" "+N[1]+this.DrawPoints.lineto+(N[0]-1)+" "+N[1];break;default:break}}G+=I}this.renderer.SetAttributes(this.DrawPolygons,{d:F});this.renderer.SetAttributes(this.DrawPolylines,{d:M});this.renderer.SetAttributes(this.DrawPoints,{d:L})}};this._Stringify=function(){var F=[];if(this.shapes.length>0){for(var G=0;G<this.shapes.length;G++){F.push(this.shapes[G].join(","))}}else{F[0]=0;F[1]=0}return"["+Pol.VI.OverlayShape.Layer+","+F.join(",")+"]"};this._Encode=function(){var G=[];for(var H=0,K=0,F=0;H<this.shapes.length;H++){var J;var I;F=this.shapes[H].length*2;J=this.xy.slice(K,K+F);if(this.shapes[H].visible){switch(this.shapes[H].type){case Pol.VI.OverlayShape.Polygon:I={st:Pol.VI.OverlayShape.Polygon,sc:this.PolygonAttr.strokeColor,sw:this.PolygonAttr.strokeWeight,so:this.PolygonAttr.strokeOpacity,fc:this.PolygonAttr.fillColor,fo:this.PolygonAttr.fillOpacity,sp:J,fi:this.PolygonAttr.fill,nr:[J.length/2]};G.push(YAHOO.lang.JSON.stringify(I));break;case Pol.VI.OverlayShape.Polyline:I={st:Pol.VI.OverlayShape.Polyline,sc:this.PolylineAttr.strokeColor,sw:this.PolylineAttr.strokeWeight,so:this.PolylineAttr.strokeOpacity,sp:J};G.push(YAHOO.lang.JSON.stringify(I));break;case Pol.VI.OverlayShape.Point:I={st:Pol.VI.OverlayShape.Point,sc:this.PointAttr.strokeColor,sw:this.PointAttr.strokeWeight,so:this.PointAttr.strokeOpacity,pr:4,sp:J};G.push(YAHOO.lang.JSON.stringify(I));break;default:break}}K+=F}return G.join(",")}};Pol.VI.ImageNavigator.prototype.AddOverlay=function(A){if(Pol.VI.OverlayUtil.IsValidShape(A)){A._Add(this);this.viewer.overlay.shapes.push(A)}};Pol.VI.ImageNavigator.prototype.RemoveOverlay=function(B){var A=this.viewer.overlay.shapes;if(Pol.VI.OverlayUtil.IsValidShape(B)){for(var C=0;C<A.length;C++){if(A[C]===B){B._Remove();A.splice(C,1)}}}};Pol.VI.ImageNavigator.prototype.RenderOverlay=function(){var A=this.viewer.overlay.shapes;if((A.length>0)&&this.IsViewActive()){this._HideOverlay();this._GetOverlay()}};Pol.VI.ImageNavigator.prototype.ClearOverlay=function(){var A=this.viewer.overlay.shapes;while(A.length>0){var B=A.pop();B._Remove()}};Pol.VI.ImageNavigator.prototype.ShowOverlay=function(){var A=this.viewer.overlay.shapes;for(var B=0;B<A.length;B++){A[B].Show()}};Pol.VI.ImageNavigator.prototype.HideOverlay=function(){var A=this.viewer.overlay.shapes;for(var B=0;B<A.length;B++){A[B].Hide()}};Pol.VI.ImageNavigator.prototype._ShowOverlay=function(){YAHOO.util.Dom.setStyle(this.viewer.overlay,"visibility","visible");YAHOO.util.Dom.setStyle(this.viewer.overlay,"display","block")};Pol.VI.ImageNavigator.prototype._HideOverlay=function(){YAHOO.util.Dom.setStyle(this.viewer.overlay,"visibility","hidden");YAHOO.util.Dom.setStyle(this.viewer.overlay,"display","none")};Pol.VI.ImageNavigator.prototype._OverlayViewChange=function(A){this.RenderOverlay();if(this.ContourCfg.visible){this._GetContourLines()}};Pol.VI.ImageNavigator.prototype._OverlayScaleChange=function(A){shapes=this.viewer.overlay.shapes;for(var B=0;B<shapes.length;B++){shapes[B]._Draw(this.ScaleFactor)}if(this.ContourCfg.visible){this._DrawContourLines()}};Pol.VI.ImageNavigator.prototype._AlignOverlay=function(){var A=this.CurrentView;var C=this.viewer.dimensions;var D=this.viewer.overlay;var B=Math.round(A.width*this.ScaleFactor);var E=Math.round(A.height*this.ScaleFactor);D.style.width=B+"px";D.style.height=E+"px";D.renderer.SetWidth(B);D.renderer.SetHeight(E);D.mx=C.halfwidth-Math.round(A.mx*this.ScaleFactor);D.my=C.halfheight-Math.round(A.my*this.ScaleFactor);D.style.left=D.mx+"px";D.style.top=D.my+"px"};Pol.VI.ImageNavigator.prototype._GetShapeData=function(){var B=this.viewer.overlay.shapes;var C="&shapes=";var A=[];for(var D=0;D<B.length;D++){A.push(B[D]._Stringify())}C+="["+A.join(",")+"]";return C};Pol.VI.ImageNavigator.prototype._GetShapeInfo=function(){var B=this.viewer.overlay.shapes;var A=[];for(var C=0;C<B.length;C++){if(B[C].IsVisible()){A.push(B[C]._Encode())}}if(this.ContourCfg.visible){A.push(this._EncodeContourLines())}return"["+A.join(",")+"]"};Pol.VI.ImageNavigator.prototype._IsShapeData=function(){return this.viewer.overlay.shapes.length>0};Pol.VI.ImageNavigator.prototype._GetOverlay=function(){var A=this.CurrentView;if(YAHOO.util.Connect.isCallInProgress(this._OverlayTransaction)){YAHOO.util.Connect.abort(this._OverlayTransaction)}var C={success:this._GetOverlaySuccess,failure:this._GetOverlayFailure,scope:this,timeout:this.RequestTimeout,argument:A.table+A.index};var B="id="+this.UserId+"&type="+this.RequestType.Overlay+"&table="+A.table+"&index="+A.index+this._GetShapeData();YAHOO.util.Connect.initHeader("If-Modified-Since","Sat, 1 Jan 2000 00:00:00 GMT");this._OverlayTransaction=YAHOO.util.Connect.asyncRequest("POST",this.ServerProxy,C,B)};Pol.VI.ImageNavigator.prototype._GetOverlaySuccess=function(F){var D;var A;var C=this._GetStatus(F);try{D=YAHOO.lang.JSON.parse(F.responseText);A=this.viewer.overlay.shapes;if(A.length==D.length){for(var B=0;B<D.length;B++){A[B]._SaveCoords(D[B]);A[B]._Draw(this.ScaleFactor)}}}catch(E){C={status:Pol.VI.Status.BadResponse.status,reason:Pol.VI.Status.BadResponse.reason}}this._ShowOverlay();this.Events.onoverlayrendered.notify(C)};Pol.VI.ImageNavigator.prototype._GetOverlayFailure=function(B){var A=this._GetStatus(B);this._ShowOverlay();this.Events.onoverlayrendered.notify(A)};Pol.VI.ImageNavigator.prototype.ShowContourLines=function(){if(this.IsViewActive()){this._GetContourLines()}};Pol.VI.ImageNavigator.prototype.HideContourLines=function(){this.ContourCfg.visible=false;this._ClearContourLines()};Pol.VI.ImageNavigator.prototype.SetContourLinesCfg=function(A){if(typeof A!="undefined"){if(A.visible){this.ContourCfg.visible=A.visible}if(A.units){if((A.units==Pol.VI.DistanceUnits.Feet)||(A.units==Pol.VI.DistanceUnits.Meters)){this.ContourCfg.units=A.units}}if(typeof A.minor!="undefined"){if(A.minor.width){this.ContourCfg.minor.width=A.minor.width}if(A.major.width){this.ContourCfg.major.width=A.major.width}if(A.minor.increment){this.ContourCfg.minor.increment=A.minor.increment}}if(typeof A.major!="undefined"){if(A.major.steps){this.ContourCfg.major.steps=A.major.steps}if(A.minor.color){this.ContourCfg.minor.color=A.minor.color}if(A.major.color){this.ContourCfg.major.color=A.major.color}}if(typeof A.annotations!="undefined"){if(A.annotations.color){this.ContourCfg.annotations.color=A.annotations.color}if(A.annotations.spacing){this.ContourCfg.annotations.spacing=A.annotations.spacing}}}if(this.ContourCfg.minor.draw!=null){this.viewer.overlay.renderer.Remove(this.ContourCfg.minor.draw)}if(this.ContourCfg.major.draw!=null){this.viewer.overlay.renderer.Remove(this.ContourCfg.major.draw)}this.ContourCfg.minor.draw=this.viewer.overlay.renderer.Create("path",this.ContourCfg.minor.color,this.ContourCfg.minor.width,1,"none",1);this.ContourCfg.major.draw=this.viewer.overlay.renderer.Create("path",this.ContourCfg.major.color,this.ContourCfg.major.width,1,"none",1)};Pol.VI.ImageNavigator.prototype.GetContourLinesCfg=function(){var B=this.ContourCfg;var A={units:B.units,minor:{width:B.minor.width,increment:B.minor.increment,color:B.minor.color},major:{width:B.major.width,steps:B.major.steps,color:B.major.color},annotations:{color:B.annotations.color,spacing:B.annotations.spacing}};return A};Pol.VI.ImageNavigator.prototype._ClearContourLines=function(){if(this.ContourCfg.annotations.text.length>0){for(var A=0;A<this.ContourCfg.annotations.text.length;A++){this.viewer.overlay.renderer.Remove(this.ContourCfg.annotations.text[A]);this.ContourCfg.annotations.text[A]=null}this.ContourCfg.annotations.text=[]}this.viewer.overlay.renderer.SetAttributes(this.ContourCfg.minor.draw,{d:" "});this.viewer.overlay.renderer.SetAttributes(this.ContourCfg.major.draw,{d:" "})};Pol.VI.ImageNavigator.prototype._DrawContourLines=function(){var S=this.ScaleFactor;var K=this.viewer.overlay.renderer;var O=this.ContourCfg.points;var D=this.ContourCfg.annotations.spacing;var H=this.ContourCfg.major.draw.moveto;var G=this.ContourCfg.major.draw.lineto;var F=this.ContourCfg.major.draw.endpath;var M=(this.ContourCfg.units==Pol.VI.DistanceUnits.Feet)?" ft":" m";var C={textColor:this.ContourCfg.annotations.color,fillColor:this.ContourCfg.annotations.color,fontFamily:"Verdana",fontSize:"12px",fontWeight:"normal",fontStyle:"normal",textAnchor:"start",textOpacity:1,fillOpacity:1};this._ClearContourLines();if(this.ContourCfg.visible){var B=[];var L=[];for(var P=0;P<O.length;P++){var I=O[P].XArray;var Q=O[P].YArray;var R=O[P].isMajor;var J=R?L:B;var A=true;J.push(H+(Math.round(I[0]*S))+" "+(Math.round(Q[0]*S))+" "+G);for(var N=1;N<I.length;N++){J.push((Math.round(I[N]*S))+" "+(Math.round(Q[N]*S)));if(R&&(((N%Math.round(D/S))==0)||A)){var E=K.Create("text","none","1","1.0","none",1);C.text=O[P].elevation+M;C.x=Math.round(I[N]*S);C.y=Math.round(Q[N]*S);K.SetAttributes(E,C);this.ContourCfg.annotations.text.push(E);A=false}}J.push(F)}K.SetAttributes(this.ContourCfg.major.draw,{d:L.join(" ")});K.SetAttributes(this.ContourCfg.minor.draw,{d:B.join(" ")})}};Pol.VI.ImageNavigator.prototype._GetContourLines=function(){var A=this.CurrentView;this.ContourCfg.points=[];this._ClearContourLines();if(YAHOO.util.Connect.isCallInProgress(this._ContourTransaction)){YAHOO.util.Connect.abort(this._ContourTransaction)}var C={success:this._GetContourLinesSuccess,failure:this._GetContourLinesFailure,scope:this,timeout:this.RequestTimeout,argument:A.table+A.index};var B="id="+this.UserId+"&type="+this.RequestType.Contour+"&table="+A.table+"&index="+A.index+"&units="+this.ContourCfg.units+"&steps="+this.ContourCfg.major.steps+"&incr="+this.ContourCfg.minor.increment;YAHOO.util.Connect.initHeader("If-Modified-Since","Sat, 1 Jan 2000 00:00:00 GMT");this._ContourTransaction=YAHOO.util.Connect.asyncRequest("POST",this.ServerProxy,C,B)};Pol.VI.ImageNavigator.prototype._GetContourLinesSuccess=function(C){var A=this._GetStatus(C);try{this.ContourCfg.points=YAHOO.lang.JSON.parse(C.responseText);this.ContourCfg.visible=true;this._DrawContourLines()}catch(B){A={status:Pol.VI.Status.BadResponse.status,reason:Pol.VI.Status.BadResponse.reason}}this._ShowOverlay();this.Events.onoverlayrendered.notify(A)};Pol.VI.ImageNavigator.prototype._GetContourLinesFailure=function(B){var A=this._GetStatus(B);this._ShowOverlay();this.Events.onoverlayrendered.notify(A)};Pol.VI.ImageNavigator.prototype._EncodeContourLines=function(){var A={st:Pol.VI.OverlayShape.Contour,nc:this.ContourCfg.minor.color,nw:this.ContourCfg.minor.width,mc:this.ContourCfg.major.color,mw:this.ContourCfg.major.width,ms:this.ContourCfg.major.steps,mi:this.ContourCfg.minor.increment,un:this.ContourCfg.units,ac:this.ContourCfg.annotations.color,as:this.ContourCfg.annotations.spacing,sf:this.ScaleFactor};return YAHOO.lang.JSON.stringify(A)};Pol.VI.ImageTools={NoTool:0,Distance:1,Height:2,Location:3,Area:4,Elevation:5,Bearing:6,Pitch:7,Select:8};Pol.VI.DistanceResult={};Pol.VI.HeightResult={};Pol.VI.LocationResult={};Pol.VI.AreaResult={};Pol.VI.ElevationResult={};Pol.VI.BearingResult={};Pol.VI.PitchResult={};Pol.VI.ImageNavigator.prototype._InitTools=function(){this.DistanceUnit=Pol.VI.DistanceUnits.Feet;this.AreaUnit=Pol.VI.AreaUnits.SquareFeet;this.LocationUnit=Pol.VI.LocationUnits.Degrees;this.AngleUnit=Pol.VI.AngleUnits.Degrees;this.ImageX=[];this.ImageY=[];this.IntermediateX=[];this.IntermediateY=[];this.MouseX=[];this.MouseY=[];this.LineSegmentX=[];this.LineSegmentY=[];this.TranslateX=0;this.TranslateY=0;this.ToolsRenderer=null;this.DrawTool=null;this.Measuring=false;this.IsKeyUp=true;this.IsMultiImage=false;this.IsIntermediate=false;this.NoDistance=0;this.LineDistance=1;this.BoxDistance=2;this.FreeFormDistance=3;this.SelectDistance=4;this.DistanceType=this.LineDistance;this.SinglePoint=0;this.MultiPoint=1;this.MeasurementType=this.MultiPoint;this.SelectedTool=Pol.VI.ImageTools.NoTool;this.SelectedUnit=0;this.ToolCursor="default";this.ToolStrokeColor="#00ffff";this.ToolStrokeWeight=1;this.PitchState=0;this.SelectedArea={ul:{x:0,y:0},lr:{x:0,y:0}};this.viewer.measure=document.createElement("div");YAHOO.util.Dom.generateId(this.viewer.measure,"pol-vi-measure");this.viewer.measure.className="pol-vi-measure";YAHOO.util.Dom.setStyle(this.viewer.measure,"background-image","url("+Pol.VI.ConfigParams.BaseUrl+"i/transparentpixel.gif)");this.viewer.measure.style.cursor=this.ToolCursor;this.viewer.measure.style.width=this.viewer.style.width;this.viewer.measure.style.height=this.viewer.style.height;this.viewer.measure.style.zIndex=2;YAHOO.util.Event.addListener(this.viewer.measure,"mousedown",this._OnStartMeasurement,this);this.viewer.measure.style.display="none";this.viewer.appendChild(this.viewer.measure);this.ViewerElements.push(this.viewer.measure);this.ToolsRenderer=Pol.VI.GetRenderer();this.ToolsRenderer.Init(this.viewer.measure);this.DrawTool=this.ToolsRenderer.Create("path",this.ToolStrokeColor,this.ToolStrokeWeight,1,"none",1);this.PlumbTool=this.ToolsRenderer.Create("path",this.ToolStrokeColor,this.ToolStrokeWeight,1,"none",1);this.MultiImage=[];this.ToolOptions={wte:false,plumb:false,plumbColor:this.ToolStrokeColor,plumbWeight:this.ToolStrokeWeight,topdown:false}};Pol.VI.ImageNavigator.prototype._OnStartMeasurement=function(H,D){var G=D.CurrentView;var K=YAHOO.util.Event.getXY(H);var E=D.viewer.dimensions;var F=D._GetXY(D.viewer,K[0],K[1]);var I=(D.SelectedTool==Pol.VI.ImageTools.Select)?"onstartselect":"onstartmeasurement";var L;var J;var C;var B;D.Measuring=true;D.ToolsRenderer.SetAttributes(D.PlumbTool,{d:" "});window.focus();if((D.SelectedTool==Pol.VI.ImageTools.Pitch)&&(D.PitchState!=0)){L=F.x-E.halfwidth;J=F.y-E.halfheight;L=Math.round(L/D.ScaleFactor);J=Math.round(J/D.ScaleFactor);C=G.mx+L;B=G.my+J;if(D.DistanceType!=D.BoxDistance){D.ImageX.push(C);D.ImageY.push(B)}if(D.PitchState==1){D.DrawTool.pathdata+=D.DrawTool.moveto+F.x+" "+F.y+" "+D.DrawTool.lineto}D.MouseX[0]=F.x;D.MouseY[0]=F.y}else{D.DrawTool.pathorigin=D.DrawTool.moveto+F.x+" "+F.y;D.DrawTool.pathdata=D.DrawTool.pathorigin+" "+D.DrawTool.lineto;D.TranslateX=D.TranslateY=0;D.MouseX.length=D.MouseY.length=0;D.LineSegmentX.length=D.LineSegmentY.length=0;D.ImageX.length=D.ImageY.length=0;D.MouseX[0]=F.x;D.MouseY[0]=F.y;YAHOO.util.Event.addListener(document,"keydown",D._OnKeyDownMeasure,D);YAHOO.util.Event.addListener(document,"keyup",D._OnKeyUpMeasure,D);YAHOO.util.Event.addListener(document,"mouseup",D._OnEndMeasurement,D);YAHOO.util.Event.addListener(document,"mousemove",D._OnMoveMeasure,D);L=F.x-E.halfwidth;J=F.y-E.halfheight;L=Math.round(L/D.ScaleFactor);J=Math.round(J/D.ScaleFactor);C=G.mx+L;B=G.my+J;D.ImageX[0]=C;D.ImageY[0]=B;var A={mouse:{x:F.x,y:F.y},image:{x:C,y:B}};D.Events[I].notify(A);YAHOO.util.Event.preventDefault(H)}};Pol.VI.ImageNavigator.prototype._OnEndMeasurement=function(H,D){var G=D.CurrentView;var K=YAHOO.util.Event.getXY(H);var E=D.viewer.dimensions;var F=D._GetXY(D.viewer,K[0],K[1]);var I=(D.SelectedTool==Pol.VI.ImageTools.Select)?"onendselect":"onendmeasurement";D.Measuring=false;D.IsIntermediate=false;if(D.SelectedTool==Pol.VI.ImageTools.Pitch){D.PitchState++}if((D.SelectedTool==Pol.VI.ImageTools.Pitch)&&(D.PitchState==1)){D.LineSegmentX[0]=F.x;D.LineSegmentY[0]=F.y;D.DrawTool.pathdata+=F.x+" "+F.y+" "}if((D.SelectedTool==Pol.VI.ImageTools.Pitch)&&(D.PitchState==2)){D.LineSegmentX[1]=F.x;D.LineSegmentY[1]=F.y;D.DrawTool.pathdata+=F.x+" "+F.y+" "+D.DrawTool.moveto+D.LineSegmentX[0]+" "+D.LineSegmentY[0]+" "+D.DrawTool.lineto+D.LineSegmentX[1]+" "+D.LineSegmentY[1]+" "}if((D.SelectedTool!=Pol.VI.ImageTools.Pitch)||(D.PitchState==3)){YAHOO.util.Event.removeListener(document,"keydown",D._OnKeyDownMeasure);YAHOO.util.Event.removeListener(document,"keyup",D._OnKeyUpMeasure);YAHOO.util.Event.removeListener(document,"mouseup",D._OnEndMeasurement);YAHOO.util.Event.removeListener(document,"mousemove",D._OnMoveMeasure)}var L=F.x-E.halfwidth;var J=F.y-E.halfheight;L=Math.round(L/D.ScaleFactor);J=Math.round(J/D.ScaleFactor);var C=G.mx+L;var B=G.my+J;if(D.IsMultiImage){D.MultiImage[1]={t:G.table,i:G.index,x:C,y:B}}else{D.MultiImage[0]={t:G.table,i:G.index,x:C,y:B}}if(D.DistanceType!=D.BoxDistance){D.ImageX.push(C);D.ImageY.push(B);if(D.SelectedTool==Pol.VI.ImageTools.Area){D._ClosePath()}}if((D.SelectedTool==Pol.VI.ImageTools.Distance)&&(D.DistanceType==D.BoxDistance)){D.ImageX.push(D.ImageX[0]);D.ImageY.push(D.ImageY[0])}if(D.DistanceType==D.SelectDistance){if(D.ImageX[0]<C){D.SelectedArea.ul.x=D.ImageX[0];D.SelectedArea.lr.x=C}else{D.SelectedArea.ul.x=C;D.SelectedArea.lr.x=D.ImageX[0]}if(D.ImageY[0]>B){D.SelectedArea.ul.y=B;D.SelectedArea.lr.y=D.ImageY[0]}else{D.SelectedArea.ul.y=D.ImageY[0];D.SelectedArea.lr.y=B}}if(D.DistanceType==D.FreeFormDistance){D._RemoveRedundantPoints()}if((D.SelectedTool!=Pol.VI.ImageTools.Pitch)||(D.PitchState==3)){var A={mouse:{x:F.x,y:F.y},image:{x:C,y:B}};D.PitchState=0;D.Events[I].notify(A);D._OnKeyUpMeasure(H,D);D._ResetMode(D);YAHOO.util.Event.preventDefault(H)}};Pol.VI.ImageNavigator.prototype._OnMoveMeasure=function(U,Q){var O=Q.CurrentView;var K=YAHOO.util.Event.getXY(U);var d=Q.viewer.dimensions;var P=Q._GetXY(Q.viewer,K[0],K[1]);var a=Q.ToolsRenderer;var S;var R;var H;var C;var Z;var X;if(Q.Measuring){var L=Math.round(10*Q.ScaleFactor);Q.MouseX.push(P.x);Q.MouseY.push(P.y);if(P.x<0){Q.PanImage(-10,0);Q.TranslateX+=L}if(P.y<0){Q.PanImage(0,-10);Q.TranslateY+=L}if(P.x>d.width){Q.PanImage(10,0);Q.TranslateX-=L}if(P.y>d.height){Q.PanImage(0,10);Q.TranslateY-=L}var c=P.x-Q.TranslateX;var b=P.y-Q.TranslateY;a.SetAttributes(Q.DrawTool,{translate:Q.TranslateX+","+Q.TranslateY});if(Q.ToolOptions.plumb){a.SetAttributes(Q.PlumbTool,{translate:Q.TranslateX+","+Q.TranslateY})}if(Q.DistanceType==Q.LineDistance){if((Q.SelectedTool==Pol.VI.ImageTools.Pitch)&&(Q.PitchState==2)){S=P.x-Q.LineSegmentX[1];R=P.y-Q.LineSegmentY[1];H=Math.atan2(S,R);C=Math.sqrt((S*S)+(R*R));Q.LineSegmentX[2]=P.x;Q.LineSegmentY[2]=P.y;Q.LineSegmentX[3]=Math.round(Q.LineSegmentX[0]+(Math.sin(H)*C));Q.LineSegmentY[3]=Math.round(Q.LineSegmentY[0]+(Math.cos(H)*C));Z=Q.LineSegmentX[3]-Q.TranslateX;X=Q.LineSegmentY[3]-Q.TranslateY;a.SetAttributes(Q.DrawTool,{d:Q.DrawTool.pathdata+c+" "+b+" "+Z+" "+X+Q.DrawTool.closepath})}else{a.SetAttributes(Q.DrawTool,{d:Q.DrawTool.pathdata+c+" "+b})}}else{if(Q.DistanceType==Q.BoxDistance){S=P.x-Q.LineSegmentX[1];R=P.y-Q.LineSegmentY[1];H=Math.atan2(S,R);C=Math.sqrt((S*S)+(R*R));Q.LineSegmentX[2]=P.x;Q.LineSegmentY[2]=P.y;Q.LineSegmentX[3]=Math.round(Q.LineSegmentX[0]+(Math.sin(H)*C));Q.LineSegmentY[3]=Math.round(Q.LineSegmentY[0]+(Math.cos(H)*C));Z=Q.LineSegmentX[3]-Q.TranslateX;X=Q.LineSegmentY[3]-Q.TranslateY;a.SetAttributes(Q.DrawTool,{d:Q.DrawTool.pathdata+c+" "+b+" "+Z+" "+X+Q.DrawTool.closepath});for(var e=2;e<4;e++){var G=Q.LineSegmentX[e]-d.halfwidth;var F=Q.LineSegmentY[e]-d.halfheight;G=Math.round(G/Q.ScaleFactor);F=Math.round(F/Q.ScaleFactor);Q.ImageX[e]=O.mx+G;Q.ImageY[e]=O.my+F}}else{if(Q.DistanceType==Q.FreeFormDistance){var W=Q.MouseX[Q.MouseX.length-2];var T=Q.MouseY[Q.MouseY.length-2];var g=Q.MouseX[Q.MouseX.length-1];var f=Q.MouseY[Q.MouseY.length-1];Q.DrawTool.pathdata+=" "+c+" "+b+" ";a.SetAttributes(Q.DrawTool,{d:Q.DrawTool.pathdata});var E=W-d.halfwidth;var D=T-d.halfheight;var B=g-d.halfwidth;var A=f-d.halfheight;E=Math.round(E/Q.ScaleFactor);D=Math.round(D/Q.ScaleFactor);B=Math.round(B/Q.ScaleFactor);A=Math.round(A/Q.ScaleFactor);Q.ImageX.push(O.mx+E);Q.ImageY.push(O.my+D);Q.ImageX.push(O.mx+B);Q.ImageY.push(O.my+A)}else{if(Q.DistanceType==Q.SelectDistance){var N=c-Q.MouseX[0];var M=b-Q.MouseY[0];var Y=Q.MouseX[0];var V=Q.MouseY[0]+M;var j=c;var h=b;var J=Q.MouseX[0]+N;var I=Q.MouseY[0];a.SetAttributes(Q.DrawTool,{d:Q.DrawTool.pathdata+Y+" "+V+" "+j+" "+h+" "+J+" "+I+Q.DrawTool.closepath})}}}}}YAHOO.util.Event.preventDefault(U)};Pol.VI.ImageNavigator.prototype._ClosePath=function(){this.ToolsRenderer.SetAttributes(this.DrawTool,{d:this.DrawTool.pathdata+this.DrawTool.closepath})};Pol.VI.ImageNavigator.prototype._OnKeyDownMeasure=function(A,B){if(B.Measuring&&(B.IsKeyUp||(A.keyCode==16))){B.IsKeyUp=false;switch(A.keyCode){case 16:B._DoMeasurement(B);break;case 17:if(B.SelectedTool==Pol.VI.ImageTools.Elevation){B.DistanceType=B.LineDistance;B.MeasurementType=B.MultiPoint}else{if(B.SelectedTool==Pol.VI.ImageTools.Bearing){B._SaveLineSegment(B,false)}else{B.DistanceType=B.BoxDistance;B._SaveLineSegment(B,true)}}break;case 18:if(B.SelectedTool==Pol.VI.ImageTools.Height){B.DistanceType=B.LineDistance}else{B.DistanceType=B.FreeFormDistance}break;case 86:B._SaveLineSegment(B,true);break;case 80:case 107:B.IsMultiImage=true;break;default:B.DistanceType=B.LineDistance;break}}YAHOO.util.Event.preventDefault(A)};Pol.VI.ImageNavigator.prototype._ResetMode=function(A){if((A.SelectedTool==Pol.VI.ImageTools.Elevation)||(A.SelectedTool==Pol.VI.ImageTools.Location)){A.DistanceType=A.NoDistance;A.MeasurementType=A.SinglePoint}else{if(A.SelectedTool!=Pol.VI.ImageTools.Select){A.DistanceType=A.LineDistance;A.MeasurementType=A.MultiPoint}}};Pol.VI.ImageNavigator.prototype._OnKeyUpMeasure=function(A,B){B.IsKeyUp=true;YAHOO.util.Event.preventDefault(A)};Pol.VI.ImageNavigator.prototype._DoMeasurement=function(H){var D=H.CurrentView;var G=H.viewer.dimensions;H.IntermediateX=H.ImageX.slice(0);H.IntermediateY=H.ImageY.slice(0);H.IsIntermediate=true;var E=H.MouseX[H.MouseX.length-1]-G.halfwidth;var C=H.MouseY[H.MouseY.length-1]-G.halfheight;E=Math.round(E/H.ScaleFactor);C=Math.round(C/H.ScaleFactor);var B=D.mx+E;var A=D.my+C;if(H.DistanceType!=H.BoxDistance){H.IntermediateX.push(B);H.IntermediateY.push(A)}var F={mouse:{x:H.MouseX[H.MouseX.length-1],y:H.MouseY[H.MouseY.length-1]},image:{x:B,y:A}};H.Events.onendmeasurement.notify(F)};Pol.VI.ImageNavigator.prototype._SaveLineSegment=function(G,D){var B=G.CurrentView;var F=G.viewer.dimensions;var H=G.MouseX[G.MouseX.length-1];var E=G.MouseY[G.MouseY.length-1];G.DrawTool.pathdata+=" "+(H-G.TranslateX)+" "+(E-G.TranslateY)+" ";var C=H-F.halfwidth;var A=E-F.halfheight;C=Math.round(C/G.ScaleFactor);A=Math.round(A/G.ScaleFactor);G.ImageX.push(B.mx+C);G.ImageY.push(B.my+A);G.LineSegmentX.push(G.MouseX[0]);G.LineSegmentX.push(H);G.LineSegmentY.push(G.MouseY[0]);G.LineSegmentY.push(E);if(D){G.MouseX.length=G.MouseY.length=0;G.MouseX[0]=H;G.MouseY[0]=E}else{G.DrawTool.pathdata+=" "+G.DrawTool.pathorigin+" "+G.DrawTool.lineto;G.MouseX.length=G.MouseY.length=1}};Pol.VI.ImageNavigator.prototype.Measure=function(A){if((this.SelectedTool!=Pol.VI.ImageTools.Select)&&(this.SelectedTool!=Pol.VI.ImageTools.NoTool)&&this.IsViewActive()){var B=this.CurrentView;var F=this.IsIntermediate?this.IntermediateX.slice(0):this.ImageX.slice(0);var D=this.IsIntermediate?this.IntermediateY.slice(0):this.ImageY.slice(0);this.IsIntermediate=false;if((this.SelectedTool==Pol.VI.ImageTools.Height)&&this.ToolOptions.topdown){F.reverse();D.reverse()}var C="id="+this.UserId+"&type="+this.RequestType.Measure+"&tool="+this.SelectedTool+"&unit="+this.SelectedUnit+"&mt="+this.MeasurementType+"&gp="+this.GroundPlane.offset+"&table="+B.table+"&index="+B.index+"&ImageX="+F.toString()+"&ImageY="+D.toString();if(this.IsMultiImage){C+="&mi="+YAHOO.lang.JSON.stringify(this.MultiImage)}if((this.SelectedTool==Pol.VI.ImageTools.Distance)&&this.ToolOptions.wte){C+="&wte=1"}this.IsMultiImage=false;var E={success:this._MeasureSuccess,failure:this._MeasureFailure,scope:this,timeout:this.RequestTimeout,argument:{fn:A,tool:this.SelectedTool,shape:this._GetMeasurementShape()}};YAHOO.util.Connect.initHeader("If-Modified-Since","Sat, 1 Jan 2000 00:00:00 GMT");YAHOO.util.Connect.asyncRequest("POST",this.ServerProxy,E,C)}};Pol.VI.ImageNavigator.prototype._Compute=function(B,C,E,A){if(this.IsViewActive()){var D="id="+this.UserId+"&type="+this.RequestType.Compute+"&tool="+C+"&unit="+E+"&shape="+B;var F={success:this._MeasureSuccess,failure:this._MeasureFailure,scope:this,timeout:this.RequestTimeout,argument:{fn:A,tool:C,shape:0}};YAHOO.util.Connect.initHeader("If-Modified-Since","Sat, 1 Jan 2000 00:00:00 GMT");YAHOO.util.Connect.asyncRequest("POST",this.ServerProxy,F,D)}};Pol.VI.ImageNavigator.prototype._MeasureSuccess=function(A){var D;var C;var I;var H=this._GetStatus(A);try{C=YAHOO.lang.JSON.parse(A.responseText);D=A.argument.tool;switch(D){case Pol.VI.ImageTools.Location:I={status:H.status,reason:H.reason,tool:D,shape:A.argument.shape,unit:C.unit,latitude:C.latitude,longitude:C.longitude};break;case Pol.VI.ImageTools.Pitch:I={status:H.status,reason:H.reason,tool:D,shape:A.argument.shape,area:C.area,angle:C.angle,eave:C.eave,peak:C.peak,pitch:C.pitch};break;case Pol.VI.ImageTools.Elevation:I={status:H.status,reason:H.reason,tool:D,shape:A.argument.shape,value:C.value,distance:C.distance,unit:C.unit};break;default:I={status:H.status,reason:H.reason,tool:D,shape:A.argument.shape,value:C.value,unit:C.unit};if(C.mi){var G=[];var F=[];G[0]=this.MultiImage[1].x;G[1]=C.mi.x;F[0]=this.MultiImage[1].y;F[1]=C.mi.y;this._RefreshDrawTool(this.DrawTool,G,F)}if(this.ToolOptions.wte&&C.wtex&&C.wtey){this._RefreshDrawTool(this.DrawTool,C.wtex,C.wtey)}if(this.ToolOptions.plumb&&C.hx&&C.hx){this._RefreshDrawTool(this.PlumbTool,C.hx,C.hy)}if((D==Pol.VI.ImageTools.Height)&&this.GroundPlane.capture){var B={active:true,elevation:C.xd.e,offset:C.xd.z};this._ClearGroundPlaneCapture();this.GroundPlane.active=true;this.GroundPlane.elevation=C.xd.e;this.GroundPlane.offset=C.xd.z;this.Events.ongroundplanechange.notify(B)}break}}catch(E){I={status:Pol.VI.Status.BadResponse.status,reason:Pol.VI.Status.BadResponse.reason}}A.argument.fn(I)};Pol.VI.ImageNavigator.prototype._MeasureFailure=function(B){var A=this._GetStatus(B);B.argument.fn(A)};Pol.VI.ImageNavigator.prototype.SetImageTool=function(A,C){var B=(C!=undefined)?true:false;this.ClearMeasurement();switch(A){case 0:this.SelectedTool=Pol.VI.ImageTools.NoTool;this.SelectedUnit=0;this.ToolCursor="default";this.viewer.measure.style.display="none";break;case 1:this.SelectedTool=Pol.VI.ImageTools.Distance;this.SelectedUnit=this.DistanceUnit;this.DistanceType=this.LineDistance;this.MeasurementType=this.MultiPoint;this.viewer.measure.style.display="block";this.ToolCursor=B?C:Pol.VI.ConfigParams.BaseUrl+"i/cursors/distance.cur";break;case 2:this.SelectedTool=Pol.VI.ImageTools.Height;this.SelectedUnit=this.DistanceUnit;this.DistanceType=this.LineDistance;this.MeasurementType=this.MultiPoint;this.viewer.measure.style.display="block";this.ToolCursor=B?C:Pol.VI.ConfigParams.BaseUrl+"i/cursors/height.cur";break;case 3:this.SelectedTool=Pol.VI.ImageTools.Location;this.SelectedUnit=this.LocationUnit;this.DistanceType=this.NoDistance;this.MeasurementType=this.SinglePoint;this.viewer.measure.style.display="block";this.ToolCursor=B?C:Pol.VI.ConfigParams.BaseUrl+"i/cursors/locale.cur";break;case 4:this.SelectedTool=Pol.VI.ImageTools.Area;this.SelectedUnit=this.AreaUnit;this.DistanceType=this.LineDistance;this.MeasurementType=this.MultiPoint;this.viewer.measure.style.display="block";this.ToolCursor=B?C:Pol.VI.ConfigParams.BaseUrl+"i/cursors/area.cur";break;case 5:this.SelectedTool=Pol.VI.ImageTools.Elevation;this.SelectedUnit=this.DistanceUnit;this.DistanceType=this.NoDistance;this.MeasurementType=this.SinglePoint;this.viewer.measure.style.display="block";this.ToolCursor=B?C:Pol.VI.ConfigParams.BaseUrl+"i/cursors/elevation.cur";break;case 6:this.SelectedTool=Pol.VI.ImageTools.Bearing;this.SelectedUnit=this.AngleUnit;this.DistanceType=this.LineDistance;this.MeasurementType=this.MultiPoint;this.viewer.measure.style.display="block";this.ToolCursor=B?C:Pol.VI.ConfigParams.BaseUrl+"i/cursors/bearing.cur";break;case 7:this.SelectedTool=Pol.VI.ImageTools.Pitch;this.PitchState=0;this.SelectedUnit=this.AreaUnit;this.DistanceType=this.LineDistance;this.MeasurementType=this.MultiPoint;this.viewer.measure.style.display="block";this.ToolCursor=B?C:Pol.VI.ConfigParams.BaseUrl+"i/cursors/pitchedareacursor.cur";break;case 8:this.SelectedTool=Pol.VI.ImageTools.Select;this.DistanceType=this.SelectDistance;this.viewer.measure.style.display="block";this.ToolCursor=B?C:Pol.VI.ConfigParams.BaseUrl+"i/cursors/cross.cur";break;default:break}this.viewer.measure.style.cursor="url("+this.ToolCursor+"),crosshair"};Pol.VI.ImageNavigator.prototype.SetToolOptions=function(A){if(A.wte!=undefined){this.ToolOptions.wte=A.wte}if(A.plumb!=undefined){this.ToolOptions.plumb=A.plumb}if(A.plumbColor!=undefined){this.ToolOptions.plumbColor=A.plumbColor;this.ToolsRenderer.SetAttributes(this.PlumbTool,{strokeColor:A.plumbColor})}if(A.plumbWeight!=undefined){this.ToolOptions.plumbWeight=A.plumbWeight;this.ToolsRenderer.SetAttributes(this.PlumbTool,{strokeWeight:A.plumbWeight})}if(A.topdown!=undefined){this.ToolOptions.topdown=A.topdown}};Pol.VI.ImageNavigator.prototype.GetToolOptions=function(){return this.ToolOptions};Pol.VI.ImageNavigator.prototype.GetImageTool=function(){return this.SelectedTool};Pol.VI.ImageNavigator.prototype.GetToolCursor=function(){return this.ToolCursor};Pol.VI.ImageNavigator.prototype.SetDistanceUnit=function(A){this.DistanceUnit=A;this.SetImageTool(this.GetImageTool(),this.GetToolCursor())};Pol.VI.ImageNavigator.prototype.GetDistanceUnit=function(){return this.DistanceUnit};Pol.VI.ImageNavigator.prototype.SetAreaUnit=function(A){this.AreaUnit=A;this.SetImageTool(this.GetImageTool(),this.GetToolCursor())};Pol.VI.ImageNavigator.prototype.GetAreaUnit=function(){return this.AreaUnit};Pol.VI.ImageNavigator.prototype.SetLocationUnit=function(A){this.LocationUnit=A;this.SetImageTool(this.GetImageTool(),this.GetToolCursor())};Pol.VI.ImageNavigator.prototype.GetLocationUnit=function(){return this.LocationUnit};Pol.VI.ImageNavigator.prototype.SetAngleUnit=function(A){this.AngleUnit=A;this.SetImageTool(this.GetImageTool(),this.GetToolCursor())};Pol.VI.ImageNavigator.prototype.GetAngleUnit=function(){return this.AngleUnit};Pol.VI.ImageNavigator.prototype.SetColor=function(A){this.ToolStrokeColor=A;this.ToolsRenderer.SetAttributes(this.DrawTool,{strokeColor:A})};Pol.VI.ImageNavigator.prototype.GetColor=function(){return this.ToolStrokeColor};Pol.VI.ImageNavigator.prototype.SetThickness=function(A){if(typeof(A)=="string"){A=parseInt(A)}this.ToolStrokeWeight=A;this.ToolsRenderer.SetAttributes(this.DrawTool,{strokeWeight:A})};Pol.VI.ImageNavigator.prototype.GetThickness=function(){return this.ToolStrokeWeight};Pol.VI.ImageNavigator.prototype.GetSelectedArea=function(){return this.SelectedArea};Pol.VI.ImageNavigator.prototype.ClearMeasurement=function(){this.ToolsRenderer.SetAttributes(this.DrawTool,{d:" "});this.ToolsRenderer.SetAttributes(this.PlumbTool,{d:" "})};Pol.VI.ImageNavigator.prototype.SaveToolsConfig=function(){var C=365;var B=new Date();var A;B.setTime(B.getTime()+(C*24*60*60*1000));A="; expires="+B.toGMTString();document.cookie="DistanceUnit="+this.DistanceUnit+A+"; path=/";document.cookie="AreaUnit="+this.AreaUnit+A+"; path=/";document.cookie="LocationUnit="+this.LocationUnit+A+"; path=/";document.cookie="AngleUnit="+this.AngleUnit+A+"; path=/";document.cookie="LineThickness="+this.ToolStrokeWeight+A+"; path=/";document.cookie="LineColor="+this.ToolStrokeColor+A+"; path=/"};Pol.VI.ImageNavigator.prototype.ReadToolsConfig=function(){var B;if((B=A("DistanceUnit"))!=null){if(B.length>0){B=parseInt(B);this.SetDistanceUnit(B)}}if((B=A("AreaUnit"))!=null){if(B.length>0){B=parseInt(B);this.SetAreaUnit(B)}}if((B=A("LocationUnit"))!=null){if(B.length>0){B=parseInt(B);this.SetLocationUnit(B)}}if((B=A("AngleUnit"))!=null){if(B.length>0){B=parseInt(B);this.SetAngleUnit(B)}}if((B=A("LineThickness"))!=null){if(B.length>0){B=parseInt(B);this.SetThickness(B)}}if((B=A("LineColor"))!=null){if(B.length>0){this.SetColor(B)}}function A(D){var F=D+"=";var C=document.cookie.split(";");for(var E=0;E<C.length;E++){var G=C[E];while(G.charAt(0)==" "){G=G.substring(1,G.length)}if(G.indexOf(F)==0){return G.substring(F.length,G.length)}}return null}};Pol.VI.ImageNavigator.prototype.DeleteToolsConfig=function(){var B="";var A="";document.cookie="DistanceUnit="+B+A+"; path=/";document.cookie="AreaUnit="+B+A+"; path=/";document.cookie="LocationUnit="+B+A+"; path=/";document.cookie="AngleUnit="+B+A+"; path=/";document.cookie="LineThickness="+B+A+"; path=/";document.cookie="LineColor="+B+A+"; path=/"};Pol.VI.ImageNavigator.prototype.GetMeasurementPoints=function(A){var G=[];if(this.SelectedTool==Pol.VI.ImageTools.Pitch){var E=this.ImageX[5]-this.ImageX[4];var D=this.ImageY[5]-this.ImageY[4];var F=Math.atan2(E,D);var C=Math.sqrt((E*E)+(D*D));this.ImageX[6]=Math.round(this.ImageX[1]+(Math.sin(F)*C));this.ImageY[6]=Math.round(this.ImageY[1]+(Math.cos(F)*C))}for(var B=0;B<this.ImageX.length;B++){G.push(this.ImageX[B]);G.push(this.ImageY[B])}this.Translate(G,Pol.VI.Translate.ImageToLocation,A)};Pol.VI.ImageNavigator.prototype._GetMeasurementShape=function(){var A=0;switch(this.DistanceType){case 0:A=Pol.VI.OverlayShape.Point;break;case 1:case 3:A=Pol.VI.OverlayShape.Polyline;break;case 2:case 4:A=Pol.VI.OverlayShape.Polygon;break;default:break}return A};Pol.VI.ImageNavigator.prototype._RemoveRedundantPoints=function(){for(var A=0;A<this.ImageX.length-1;A++){if((this.ImageX[A]==this.ImageX[A+1])&&(this.ImageY[A]==this.ImageY[A+1])){this.ImageX.splice(A,1);this.ImageY.splice(A,1)}}};Pol.VI.ImageNavigator.prototype._RefreshDrawTool=function(C,A,G){var F;var B;var E;B=Math.round((A[0]-this.CurrentView.mx)*this.ScaleFactor)+this.viewer.dimensions.halfwidth;E=Math.round((G[0]-this.CurrentView.my)*this.ScaleFactor)+this.viewer.dimensions.halfheight;F=C.moveto+B+" "+E+" "+C.lineto;for(var D=1;D<A.length;D++){B=Math.round((A[D]-this.CurrentView.mx)*this.ScaleFactor)+this.viewer.dimensions.halfwidth-this.TranslateX;E=Math.round((G[D]-this.CurrentView.my)*this.ScaleFactor)+this.viewer.dimensions.halfheight-this.TranslateY;F+=B+" "+E+" "}this.ToolsRenderer.SetAttributes(C,{translate:this.TranslateX+","+this.TranslateY});this.ToolsRenderer.SetAttributes(C,{d:F})};Pol.VI.ImageNavigator.prototype.SetGroundPlane=function(A){this.GroundPlane.capture=false;this.GroundPlane.active=false;this.GroundPlane.elevation=0;this.GroundPlane.offset=0;this.SetImageTool(Pol.VI.ImageTools.NoTool);if(A){this.GroundPlane.capture=true;this.SetImageTool(Pol.VI.ImageTools.Height,"i/cursors/offset_c.cur")}else{var B={active:this.GroundPlane.active,elevation:this.GroundPlane.elevation,offset:this.GroundPlane.offset};this.Events.ongroundplanechange.notify(B)}};Pol.VI.ImageNavigator.prototype.GetGroundPlane=function(){var A={active:this.GroundPlane.active,elevation:this.GroundPlane.elevation,offset:this.GroundPlane.offset};return A};Pol.VI.ImageNavigator.prototype._ClearGroundPlaneCapture=function(){this.GroundPlane.capture=false;this.SetImageTool(Pol.VI.ImageTools.NoTool)};Pol.VI.RendererShapes={rect:"rect",circle:"circle",ellipse:"ellipse",line:"line",polyline:"polyline",polygon:"polygon"};Pol.VI.StyleAttributes={strokeColor:"strokeColor",strokeWeight:"strokeWeight",strokeOpacity:"strokeOpacity",fillColor:"fillColor",fillOpacity:"fillOpacity",display:"display"};Pol.VI.PolygonAttributes={points:"points"};Pol.VI.PolylineAttributes={points:"points",strokeLinecap:"strokeLinecap"};Pol.VI.EllipseAttributes={center:"center",radius:"radius"};Pol.VI.LineAttributes={start:"start",end:"end"};Pol.VI.RectangleAttributes={x:"x",y:"y",width:"width",height:"height"};Pol.VI.LinecapAttributes={butt:"butt",round:"round",square:"square"};Pol.VI.LinejoinAttributes={miter:"miter",round:"round",bevel:"bevel"};Pol.VI.SVGrenderer=function(){this.SVGroot=null;this.SVGnamespace="http://www.w3.org/2000/svg";this.XlinkNS="http://www.w3.org/1999/xlink";this.Init=function(A){this.container=A;this.container.style.MozUserSelect="none";this.SVGroot=this.container.ownerDocument.createElementNS(this.SVGnamespace,"svg");this.container.appendChild(this.SVGroot);this.SVGroot.id=A.id+"-svg"};this.Create=function(C,F,E,D,G,B){var A=null;switch(C){case"rect":A=this.container.ownerDocument.createElementNS(this.SVGnamespace,"rect");break;case"circle":A=this.container.ownerDocument.createElementNS(this.SVGnamespace,"circle");break;case"ellipse":A=this.container.ownerDocument.createElementNS(this.SVGnamespace,"ellipse");break;case"line":A=this.container.ownerDocument.createElementNS(this.SVGnamespace,"line");break;case"polyline":A=this.container.ownerDocument.createElementNS(this.SVGnamespace,"polyline");break;case"polygon":A=this.container.ownerDocument.createElementNS(this.SVGnamespace,"polygon");break;case"text":A=this.container.ownerDocument.createElementNS(this.SVGnamespace,"text");break;case"path":A=this.container.ownerDocument.createElementNS(this.SVGnamespace,"path");A.moveto="M";A.lineto="L";A.endpath="";A.closepath=" z";break;default:break}A.style.position="absolute";if(typeof F!="undefined"){A.setAttributeNS(null,"stroke",F)}else{A.setAttributeNS(null,"stroke","none")}if(typeof E!="undefined"){A.setAttributeNS(null,"stroke-width",E)}if(typeof D!="undefined"){A.setAttributeNS(null,"stroke-opacity",(+D))}if(typeof G!="undefined"){A.setAttributeNS(null,"fill",G)}else{A.setAttributeNS(null,"fill","none")}if(typeof B!="undefined"){A.setAttributeNS(null,"fill-opacity",(+B))}this.SVGroot.appendChild(A);return A};this.Remove=function(A){A.parentNode.removeChild(A)};this.SetWidth=function(B){var A=parseInt(B)+"px";this.SVGroot.setAttributeNS(null,"width",A)};this.SetHeight=function(A){var B=parseInt(A)+"px";this.SVGroot.setAttributeNS(null,"height",B)};this.Hide=function(){this.SVGroot.style.display="none"};this.Show=function(){this.SVGroot.style.display="block"};this.SetAttributes=function(E,C){if((typeof E!="undefined")&&(typeof C!="undefined")){for(attribute in C){var G=C[attribute];switch(attribute){case"strokeColor":E.setAttributeNS(null,"stroke",G);break;case"strokeWeight":E.setAttributeNS(null,"stroke-width",parseInt(G)+"px");break;case"strokeOpacity":E.setAttributeNS(null,"stroke-opacity",(+G));break;case"strokeLinecap":E.setAttributeNS(null,"stroke-linecap",G);break;case"strokeLinejoin":E.setAttributeNS(null,"stroke-linejoin",G);break;case"fillColor":E.setAttributeNS(null,"fill",G);break;case"fillRule":E.setAttributeNS(null,"fill-rule",G);break;case"fillOpacity":E.setAttributeNS(null,"fill-opacity",(+G));break;case"fontFamily":E.style.fontFamily=G;break;case"fontSize":E.style.fontSize=parseInt(G)+"px";break;case"fontWeight":E.setAttributeNS(null,"font-weight",G);break;case"fontStyle":E.setAttributeNS(null,"font-style",G);break;case"text":var B=document.createTextNode(G);E.setAttributeNS(null,"text-anchor","middle");E.appendChild(B);break;case"textAnchor":E.setAttributeNS(null,"text-anchor",G);break;case"points":E.setAttributeNS(null,"points",G);break;case"center":var F=G.split(",");E.setAttributeNS(null,"cx",parseInt(F[0])+"px");E.setAttributeNS(null,"cy",parseInt(F[1])+"px");break;case"x":E.setAttributeNS(null,"x",parseInt(G)+"px");break;case"y":E.setAttributeNS(null,"y",parseInt(G)+"px");break;case"start":var I=G.split(",");E.setAttributeNS(null,"x1",parseInt(I[0])+"px");E.setAttributeNS(null,"y1",parseInt(I[1])+"px");break;case"end":var D=G.split(",");E.setAttributeNS(null,"x2",parseInt(D[0])+"px");E.setAttributeNS(null,"y2",parseInt(D[1])+"px");break;case"radius":var A=G.split(",");if(A.length==2){E.setAttributeNS(null,"rx",parseInt(A[0])+"px");E.setAttributeNS(null,"ry",parseInt(A[1])+"px")}else{E.setAttributeNS(null,"r",parseInt(A[0])+"px")}break;case"width":E.setAttributeNS(null,"width",parseInt(G)+"px");break;case"height":E.setAttributeNS(null,"height",parseInt(G)+"px");break;case"display":E.style.display=G;break;case"d":E.setAttributeNS(null,"d",G);break;case"translate":var H="translate("+G+")";E.setAttributeNS(null,"transform",H);break;default:break}}}};this.GetMarkup=function(){return this.container.innerHTML};this.GetPathData=function(A){return A.getAttributeNS(null,"d")}};Pol.VI.VMLrenderer=function(){this.text_alignment={start:"left",middle:"center",end:"right"};this.coordsystem={origin:"0,0",size:"100000,100000",width:"100000px",height:"100000px"};this.Init=function(B){this.container=B;B.ownerDocument.namespaces.add("v","urn:schemas-microsoft-com:vml");var A=B.ownerDocument.createStyleSheet();A.addRule("v\\:group","behavior: url(#default#VML);");A.addRule("v\\:line","behavior: url(#default#VML);");A.addRule("v\\:polyline","behavior: url(#default#VML);");A.addRule("v\\:rect","behavior: url(#default#VML);");A.addRule("v\\:oval","behavior: url(#default#VML);");A.addRule("v\\:path","behavior: url(#default#VML);");A.addRule("v\\:shape","behavior: url(#default#VML);");A.addRule("v\\:text","behavior: url(#default#VML);");A.addRule("v\\:textpath","behavior: url(#default#VML);");A.addRule("v\\:fill","behavior: url(#default#VML);");A.addRule("v\\:stroke","behavior: url(#default#VML);");this.VMLroot=this.container.ownerDocument.createElement("v:group");this.VMLroot.id=B.id+"-vml";this.VMLroot.style.position="absolute";this.VMLroot.coordorigin=this.coordsystem.origin;this.VMLroot.coordsize=this.coordsystem.size;this.VMLroot.style.width=this.coordsystem.width;this.VMLroot.style.height=this.coordsystem.height;this.container.appendChild(this.VMLroot)};this.Create=function(E,I,C,D,B,F){var A=null;var H=null;var G=null;switch(E){case"rect":A=this.container.ownerDocument.createElement("v:rect");break;case"circle":case"ellipse":A=this.container.ownerDocument.createElement("v:oval");A.style.top="0px";A.style.left="0px";A.style.width="0px";A.style.height="0px";break;case"line":A=this.container.ownerDocument.createElement("v:line");break;case"polyline":A=this.container.ownerDocument.createElement("v:polyline");A.closed=false;break;case"polygon":A=this.container.ownerDocument.createElement("v:polyline");A.closed=true;break;case"text":A=this.container.ownerDocument.createElement("v:shape");A.antialias=true;A.coordorigin=this.coordsystem.origin;A.coordsize=this.coordsystem.size;A.style.width=this.coordsystem.width;A.style.height=this.coordsystem.height;A.pathElem=this.container.ownerDocument.createElement("v:path");A.pathElem.textpathok=true;A.pathElem.v="m 0,0 l 1,0 e";A.appendChild(A.pathElem);A.textElem=this.container.ownerDocument.createElement("v:textpath");A.textElem.on=true;A.appendChild(A.textElem);break;case"path":A=this.container.ownerDocument.createElement("v:shape");A.coordorigin=this.coordsystem.origin;A.coordsize=this.coordsystem.size;A.style.width=this.coordsystem.width;A.style.height=this.coordsystem.height;A.moveto="m";A.lineto="l";A.endpath=" e";A.closepath=" x";A.pathElem=this.container.ownerDocument.createElement("v:path");A.pathElem.fillok=false;A.appendChild(A.pathElem);break;default:break}A.style.position="absolute";if(typeof I!="undefined"){H=this.container.ownerDocument.createElement("v:stroke");A.stroked=true;H.color=I;if(typeof C!="undefined"){H.weight=C}if(typeof D!="undefined"){H.opacity=parseFloat(D)}A.strokeElem=H;A.appendChild(H)}else{A.stroked=false}if(typeof B!="undefined"){G=this.container.ownerDocument.createElement("v:fill");A.filled=true;G.color=B;if(typeof F!="undefined"){G.opacity=parseFloat(F)}A.fillElem=G;if((E=="path")&&(B!="none")){A.pathElem.fillok=true}A.appendChild(G)}else{A.filled=false}this.VMLroot.appendChild(A);return A};this.Remove=function(A){A.removeNode(true)};this.SetWidth=function(A){};this.SetHeight=function(A){};this.Hide=function(){this.VMLroot.style.display="none"};this.Show=function(){this.VMLroot.style.display="block"};this.SetAttributes=function(E,C){var L,F,J,D,B,K,A,H,G;if((typeof E!="undefined")&&(typeof C!="undefined")){for(attribute in C){var I=C[attribute];switch(attribute){case"strokeColor":E.strokeElem.color=I;break;case"strokeWeight":E.strokeElem.weight=parseInt(I)+"px";break;case"strokeOpacity":E.strokeElem.opacity=parseFloat(I);break;case"strokeLinecap":if(I=="butt"){E.strokeElem.endcap="flat"}else{E.strokeElem.endcap=I}break;case"strokeLinejoin":E.strokeElem.joinstyle=I;break;case"fillColor":if(I=="none"){E.pathElem.fillok=false;E.fillElem.color=I}else{E.pathElem.fillok=true;E.fillElem.color=I}break;case"fillOpacity":E.fillElem.opacity=parseFloat(I);break;case"fontFamily":E.textElem.style.fontFamily=I;break;case"fontSize":E.textElem.style.fontSize=parseInt(I)+"px";break;case"fontWeight":E.textElem.style.fontWeight=I;break;case"fontStyle":E.textElem.style.fontStyle=I;break;case"textColor":E.strokeElem.color=I;E.fillElem.color=I;break;case"textOpacity":E.strokeElem.opacity=I;E.fillElem.opacity=I;break;case"text":E.textElem.string=I;break;case"d":E.pathElem.v=I;break;case"textAnchor":E.textElem.style["v-text-align"]=this.text_alignment[I];break;case"points":if(E.closed){L=I+","+I.split(",",2).join(",");E.points.value=L}else{E.points.value=I}break;case"center":F=I.split(",");B=parseInt(F[0]);K=parseInt(F[1]);E.style.top=K+"px";E.style.left=B+"px";break;case"x":E.style.left=parseInt(I)+"px";break;case"y":E.style.top=parseInt(I)+"px";break;case"start":E.from=I;break;case"end":E.to=I;break;case"radius":A=I.split(",");K=parseInt(E.style.top);B=parseInt(E.style.left);if(A.length==2){J=parseInt(A[0]);D=parseInt(A[1]);E.style.top=(K-D)+"px";E.style.left=(B-J)+"px";E.style.width=(J*2)+"px";E.style.height=(D*2)+"px"}else{J=D=parseInt(A[0]);E.style.top=(K-D)+"px";E.style.left=(B-J)+"px";E.style.width=(J*2)+"px";E.style.height=(D*2)+"px"}break;case"width":E.style.width=parseInt(I)+"px";break;case"height":E.style.height=parseInt(I)+"px";break;case"coordsize":E.coordsize=I;break;case"translate":K=I.split(",");H=parseInt(K[0])*-1;G=parseInt(K[1])*-1;E.coordorigin=H+","+G;break;case"display":E.style.display=I;break;default:break}}}};this.GetMarkup=function(){return this.container.innerHTML};this.GetPathData=function(A){return A.pathElem.v}};Pol.VI.GetRenderer=function(){var B;var C=navigator.appVersion.match(/MSIE (\d\.\d)/);var A=(navigator.userAgent.toLowerCase().indexOf("opera")!=-1);if(!C||A){B=new Pol.VI.SVGrenderer()}else{B=new Pol.VI.VMLrenderer()}return B};function ExpandCollapseImage(imgID,expCol){var elem=document.getElementById(imgID+'FieldSet');var imgBtn=document.getElementById(imgID+'ExpColImg');if(elem!=null){if(imgBtn.title=='Expand'){elem.style.display='block';elem.style.visibility='visible';imgBtn.src=collapseImageSrc;imgBtn.title='Collapse';}
else{elem.style.display='none';elem.style.visibility='hidden';imgBtn.src=expandImageSrc;imgBtn.title='Expand';}}
return false;}
function HideControl(){var elem=document.getElementById("BoundingTable");if(elem!=null){elem.style.display='none';elem.style.visibility='hidden';}
return false;}
function RunColorPicker(colorFldIDPrefix,evnt){var elem=null;var posX=0,posY=0;var scrollX,scrollY;if(document.all){if(!document.documentElement.scrollLeft)
scrollX=document.body.scrollLeft;else
scrollX=document.documentElement.scrollLeft;if(!document.documentElement.scrollTop)
scrollY=document.body.scrollTop;else
scrollY=document.documentElement.scrollTop;}
else{scrollX=window.pageXOffset;scrollY=window.pageYOffset;}
if(window.event){evnt=window.event;elem=evnt.srcElement;posX=evnt.pageX+scrollX;posY=evnt.PageY+scrollY;}
else{elem=evnt.srcElement;posX=evnt.clientX+scrollX;posY=evnt.clientY+scrollY;}
var callingElem=document.getElementById('cpCallingControlID');callingElem.value=colorFldIDPrefix;var cpElem=document.getElementById('colorPickerTable');var cpChosenColor=document.getElementById('ChosenColor');var IfrRef=document.getElementById('DivShim');if(cpElem!=null){if(cpElem.style.visibility=='visible'){cpElem.style.visibility='hidden';cpElem.style.display='none';IfrRef.style.display="none";}
else{cpElem.style.left='254px';cpElem.style.top='30px';cpElem.style.visibility='visible';cpElem.style.display='block';cpElem.style.position='absolute';IfrRef.style.width='150px';IfrRef.style.height='192px';IfrRef.style.top=cpElem.style.top;IfrRef.style.left=cpElem.style.left;IfrRef.style.zIndex=cpElem.style.zIndex;cpElem.style.zIndex=IfrRef.style.zIndex+1;IfrRef.style.visibility='visible';IfrRef.style.position='absolute';IfrRef.style.display="block";document.getElementById('cpRed').value=document.getElementById(colorFldIDPrefix+'R').value;document.getElementById('cpGreen').value=document.getElementById(colorFldIDPrefix+'G').value;document.getElementById('cpBlue').value=document.getElementById(colorFldIDPrefix+'B').value;cpChosenColor.style.backgroundColor=elem.style.backgroundColor;}}
return false;}
function ClickedOnForm(){var clickedElem=null;if(window.Event)
clickedElem=window.Event.target;else
clickedElem=event.srcElement;if(clickedElem==null||clickedElem.id.indexOf('ColorPicker')!=-1||(clickedElem.type!=null&&clickedElem.type.indexOf('checkbox')!=-1)||clickedElem.id.indexOf('applyBtn')!=-1||clickedElem.id.indexOf('previewBtn')!=-1||clickedElem.id.indexOf('reset')!=-1||clickedElem.id.indexOf('cancelBtn')!=-1||clickedElem.id.indexOf('SymbolTypes')!=-1)
return true;var cpElem=document.getElementById('colorPickerTable');if(cpElem!=null){if(cpElem.style.visibility=='visible'){cpElem.style.visibility='hidden';cpElem.style.display='none';var IfrRef=document.getElementById('DivShim');IfrRef.style.visibility='hidden';IfrRef.style.display='none';}}
return false;}
function ClickedOnColorPicker(evnt){var clickedElem=null;if(window.event){clickedElem=evnt.srcElement;}
else{clickedElem=evnt.target;}
if(clickedElem==null||clickedElem.id.indexOf('cpApplyBtn')!=-1){ApplyColorPicker();}
return false;}
function ApplyColorPicker(){var clrR=document.getElementById('cpRed');var clrG=document.getElementById('cpGreen');var clrB=document.getElementById('cpBlue');var callingElemID=document.getElementById('cpCallingControlID').value;var callingElemR=document.getElementById(callingElemID+'R');callingElemR.value=clrR.value;var callingElemG=document.getElementById(callingElemID+'G');callingElemG.value=clrG.value;var callingElemB=document.getElementById(callingElemID+'B');callingElemB.value=clrB.value;var cpChosenColor=document.getElementById('ChosenColor');var callingElemBtn=document.getElementById(callingElemID+'ColorPickerBtn');callingElemBtn.style.backgroundColor=cpChosenColor.style.backgroundColor;return false;}
var debug=false;var isIE=(window.navigator.appName.toLowerCase().indexOf("microsoft")>=0);function SetColor(colImg){var chosen=document.getElementById('ChosenColor');chosen.style.backgroundColor=colImg.style.backgroundColor;var hexColorStr=chosen.style.backgroundColor;var red=0,green=0,blue=0;if(hexColorStr.indexOf(["#"])==-1){if(hexColorStr.indexOf(["rgb"])!=-1){var i=0,j=0;hexColorStr=hexColorStr.slice(4,-1);while(hexColorStr[i]!=','&&i<20){i++;}
red=hexColorStr.slice(0,-(hexColorStr.length-i));i++;j=i;while(hexColorStr[j]!=','&&j<20){j++;}
green=hexColorStr.slice(i,0-(hexColorStr.length-j));j++;blue=hexColorStr.slice(j);}}
else{red=parseInt(hexColorStr.substring(1,3),16);green=parseInt(hexColorStr.substring(3,5),16);blue=parseInt(hexColorStr.substring(5,7),16);}
document.getElementById('cpRed').value=red;document.getElementById('cpGreen').value=green;document.getElementById('cpBlue').value=blue;}
function GetR(){var redElem=document.getElementById('cpRed');return redElem.value;}
var numb='0123456789';var lwr='abcdefghijklmnopqrstuvwxyz';var upr='ABCDEFGHIJKLMNOPQRSTUVWXYZ';function isValid(parm,val){if(parm=="")return true;for(i=0;i<parm.length;i++){if(val.indexOf(parm.charAt(i),0)==-1)return false;}
return true;}
function isNum(parm){return isValid(parm,numb);}
function isLower(parm){return isValid(parm,lwr);}
function isUpper(parm){return isValid(parm,upr);}
function isAlpha(parm){return isValid(parm,lwr+upr);}
function isAlphanum(parm){return isValid(parm,lwr+upr+numb);}
function ShowColorPicker(visibleValue){var elem=document.getElementById("colorPickerTable");if(elem!=null){if(visibleValue=='hidden'){elem.style.display='none';elem.style.visibility='hidden';var IfrRef=document.getElementById('DivShim');IfrRef.style.visibility='hidden';IfrRef.style.display='none';}
else{elem.style.display='block';elem.style.visibility='visible';var IfrRef=document.getElementById('DivShim');IfrRef.style.visibility='block';IfrRef.style.display='visible';}}}
function PreviewColor(){var red=document.getElementById('cpRed').value;var green=document.getElementById('cpGreen').value;var blue=document.getElementById('cpBlue').value;if(red.length==0&&green.length==0&&blue.length==0){var chosen=document.getElementById('ChosenColor');chosen.style.backgroundColor='#F5F5DC';}
else{iRed=parseInt(red);iGreen=parseInt(green);iBlue=parseInt(blue);if(isNum(red)==false||iRed<0||iRed>255){document.getElementById('cpRed').value='0';iRed=0;}
if(isNum(green)==false||iGreen<0||iGreen>255){document.getElementById('cpGreen').value='0';iGreen=0;}
if(isNum(blue)==false||iBlue<0||iBlue>255){document.getElementById('cpBlue').value='0';iBlue=0;}
var chosen=document.getElementById('ChosenColor');chosen.style.backgroundColor='#'+Dec2Hex(iRed)+Dec2Hex(iGreen)+Dec2Hex(iBlue);}}
var hexChars="0123456789ABCDEF";function Dec2Hex(d){var a=d%16;var b=(d-a)/16;hex=""+hexChars.charAt(b)+hexChars.charAt(a);return hex;}
(function($){$.widget("ui.draggable",$.extend({},$.ui.mouse,{_init:function(){if(this.options.helper=='original'&&!(/^(?:r|a|f)/).test(this.element.css("position")))
this.element[0].style.position='relative';(this.options.addClasses&&this.element.addClass("ui-draggable"));(this.options.disabled&&this.element.addClass("ui-draggable-disabled"));this._mouseInit();},destroy:function(){if(!this.element.data('draggable'))return;this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable"
+" ui-draggable-dragging"
+" ui-draggable-disabled");this._mouseDestroy();},_mouseCapture:function(event){var o=this.options;if(this.helper||o.disabled||$(event.target).is('.ui-resizable-handle'))
return false;this.handle=this._getHandle(event);if(!this.handle)
return false;return true;},_mouseStart:function(event){var o=this.options;this.helper=this._createHelper(event);this._cacheHelperProportions();if($.ui.ddmanager)
$.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};$.extend(this.offset,{click:{left:event.pageX-this.offset.left,top:event.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(event);this.originalPageX=event.pageX;this.originalPageY=event.pageY;if(o.cursorAt)
this._adjustOffsetFromHelper(o.cursorAt);if(o.containment)
this._setContainment();this._trigger("start",event);this._cacheHelperProportions();if($.ui.ddmanager&&!o.dropBehaviour)
$.ui.ddmanager.prepareOffsets(this,event);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(event,true);return true;},_mouseDrag:function(event,noPropagation){this.position=this._generatePosition(event);this.positionAbs=this._convertPositionTo("absolute");if(!noPropagation){var ui=this._uiHash();this._trigger('drag',event,ui);this.position=ui.position;}
if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+'px';if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+'px';if($.ui.ddmanager)$.ui.ddmanager.drag(this,event);return false;},_mouseStop:function(event){var dropped=false;if($.ui.ddmanager&&!this.options.dropBehaviour)
dropped=$.ui.ddmanager.drop(this,event);if(this.dropped){dropped=this.dropped;this.dropped=false;}
if((this.options.revert=="invalid"&&!dropped)||(this.options.revert=="valid"&&dropped)||this.options.revert===true||($.isFunction(this.options.revert)&&this.options.revert.call(this.element,dropped))){var self=this;$(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){self._trigger("stop",event);self._clear();});}else{this._trigger("stop",event);this._clear();}
return false;},_getHandle:function(event){var handle=!this.options.handle||!$(this.options.handle,this.element).length?true:false;$(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==event.target)handle=true;});return handle;},_createHelper:function(event){var o=this.options;var helper=$.isFunction(o.helper)?$(o.helper.apply(this.element[0],[event])):(o.helper=='clone'?this.element.clone():this.element);if(!helper.parents('body').length)
helper.appendTo((o.appendTo=='parent'?this.element[0].parentNode:o.appendTo));if(helper[0]!=this.element[0]&&!(/(fixed|absolute)/).test(helper.css("position")))
helper.css("position","absolute");return helper;},_adjustOffsetFromHelper:function(obj){if(obj.left!=undefined)this.offset.click.left=obj.left+this.margins.left;if(obj.right!=undefined)this.offset.click.left=this.helperProportions.width-obj.right+this.margins.left;if(obj.top!=undefined)this.offset.click.top=obj.top+this.margins.top;if(obj.bottom!=undefined)this.offset.click.top=this.helperProportions.height-obj.bottom+this.margins.top;},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var po=this.offsetParent.offset();if(this.cssPosition=='absolute'&&this.scrollParent[0]!=document&&$.ui.contains(this.scrollParent[0],this.offsetParent[0])){po.left+=this.scrollParent.scrollLeft();po.top+=this.scrollParent.scrollTop();}
if((this.offsetParent[0]==document.body)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=='html'&&$.browser.msie))
po={top:0,left:0};return{top:po.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:po.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)};},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var p=this.element.position();return{top:p.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:p.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()};}else{return{top:0,left:0};}},_cacheMargins:function(){this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0)};},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()};},_setContainment:function(){var o=this.options;if(o.containment=='parent')o.containment=this.helper[0].parentNode;if(o.containment=='document'||o.containment=='window')this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,$(o.containment=='document'?document:window).width()-this.helperProportions.width-this.margins.left,($(o.containment=='document'?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!(/^(document|window|parent)$/).test(o.containment)&&o.containment.constructor!=Array){var ce=$(o.containment)[0];if(!ce)return;var co=$(o.containment).offset();var over=($(ce).css("overflow")!='hidden');this.containment=[co.left+(parseInt($(ce).css("borderLeftWidth"),10)||0)+(parseInt($(ce).css("paddingLeft"),10)||0)-this.margins.left,co.top+(parseInt($(ce).css("borderTopWidth"),10)||0)+(parseInt($(ce).css("paddingTop"),10)||0)-this.margins.top,co.left+(over?Math.max(ce.scrollWidth,ce.offsetWidth):ce.offsetWidth)-(parseInt($(ce).css("borderLeftWidth"),10)||0)-(parseInt($(ce).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,co.top+(over?Math.max(ce.scrollHeight,ce.offsetHeight):ce.offsetHeight)-(parseInt($(ce).css("borderTopWidth"),10)||0)-(parseInt($(ce).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top];}else if(o.containment.constructor==Array){this.containment=o.containment;}},_convertPositionTo:function(d,pos){if(!pos)pos=this.position;var mod=d=="absolute"?1:-1;var o=this.options,scroll=this.cssPosition=='absolute'&&!(this.scrollParent[0]!=document&&$.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,scrollIsRootNode=(/(html|body)/i).test(scroll[0].tagName);return{top:(pos.top
+this.offset.relative.top*mod
+this.offset.parent.top*mod
-($.browser.safari&&this.cssPosition=='fixed'?0:(this.cssPosition=='fixed'?-this.scrollParent.scrollTop():(scrollIsRootNode?0:scroll.scrollTop()))*mod)),left:(pos.left
+this.offset.relative.left*mod
+this.offset.parent.left*mod
-($.browser.safari&&this.cssPosition=='fixed'?0:(this.cssPosition=='fixed'?-this.scrollParent.scrollLeft():scrollIsRootNode?0:scroll.scrollLeft())*mod))};},_generatePosition:function(event){var o=this.options,scroll=this.cssPosition=='absolute'&&!(this.scrollParent[0]!=document&&$.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,scrollIsRootNode=(/(html|body)/i).test(scroll[0].tagName);if(this.cssPosition=='relative'&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0])){this.offset.relative=this._getRelativeOffset();}
var pageX=event.pageX;var pageY=event.pageY;if(this.originalPosition){if(this.containment){if(event.pageX-this.offset.click.left<this.containment[0])pageX=this.containment[0]+this.offset.click.left;if(event.pageY-this.offset.click.top<this.containment[1])pageY=this.containment[1]+this.offset.click.top;if(event.pageX-this.offset.click.left>this.containment[2])pageX=this.containment[2]+this.offset.click.left;if(event.pageY-this.offset.click.top>this.containment[3])pageY=this.containment[3]+this.offset.click.top;}
if(o.grid){var top=this.originalPageY+Math.round((pageY-this.originalPageY)/o.grid[1])*o.grid[1];pageY=this.containment?(!(top-this.offset.click.top<this.containment[1]||top-this.offset.click.top>this.containment[3])?top:(!(top-this.offset.click.top<this.containment[1])?top-o.grid[1]:top+o.grid[1])):top;var left=this.originalPageX+Math.round((pageX-this.originalPageX)/o.grid[0])*o.grid[0];pageX=this.containment?(!(left-this.offset.click.left<this.containment[0]||left-this.offset.click.left>this.containment[2])?left:(!(left-this.offset.click.left<this.containment[0])?left-o.grid[0]:left+o.grid[0])):left;}}
return{top:(pageY
-this.offset.click.top
-this.offset.relative.top
-this.offset.parent.top
+($.browser.safari&&this.cssPosition=='fixed'?0:(this.cssPosition=='fixed'?-this.scrollParent.scrollTop():(scrollIsRootNode?0:scroll.scrollTop())))),left:(pageX
-this.offset.click.left
-this.offset.relative.left
-this.offset.parent.left
+($.browser.safari&&this.cssPosition=='fixed'?0:(this.cssPosition=='fixed'?-this.scrollParent.scrollLeft():scrollIsRootNode?0:scroll.scrollLeft())))};},_clear:function(){this.helper.removeClass("ui-draggable-dragging");if(this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval)this.helper.remove();this.helper=null;this.cancelHelperRemoval=false;},_trigger:function(type,event,ui){ui=ui||this._uiHash();$.ui.plugin.call(this,type,[event,ui]);if(type=="drag")this.positionAbs=this._convertPositionTo("absolute");return $.widget.prototype._trigger.call(this,type,event,ui);},plugins:{},_uiHash:function(event){return{helper:this.helper,position:this.position,absolutePosition:this.positionAbs,offset:this.positionAbs};}}));$.extend($.ui.draggable,{version:"1.7.2",eventPrefix:"drag",defaults:{addClasses:true,appendTo:"parent",axis:false,cancel:":input,option",connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,delay:0,distance:1,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false}});$.ui.plugin.add("draggable","connectToSortable",{start:function(event,ui){var inst=$(this).data("draggable"),o=inst.options,uiSortable=$.extend({},ui,{item:inst.element});inst.sortables=[];$(o.connectToSortable).each(function(){var sortable=$.data(this,'sortable');if(sortable&&!sortable.options.disabled){inst.sortables.push({instance:sortable,shouldRevert:sortable.options.revert});sortable._refreshItems();sortable._trigger("activate",event,uiSortable);}});},stop:function(event,ui){var inst=$(this).data("draggable"),uiSortable=$.extend({},ui,{item:inst.element});$.each(inst.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;inst.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert)this.instance.options.revert=true;this.instance._mouseStop(event);this.instance.options.helper=this.instance.options._helper;if(inst.options.helper=='original')
this.instance.currentItem.css({top:'auto',left:'auto'});}else{this.instance.cancelHelperRemoval=false;this.instance._trigger("deactivate",event,uiSortable);}});},drag:function(event,ui){var inst=$(this).data("draggable"),self=this;var checkPos=function(o){var dyClick=this.offset.click.top,dxClick=this.offset.click.left;var helperTop=this.positionAbs.top,helperLeft=this.positionAbs.left;var itemHeight=o.height,itemWidth=o.width;var itemTop=o.top,itemLeft=o.left;return $.ui.isOver(helperTop+dyClick,helperLeft+dxClick,itemTop,itemLeft,itemHeight,itemWidth);};$.each(inst.sortables,function(i){this.instance.positionAbs=inst.positionAbs;this.instance.helperProportions=inst.helperProportions;this.instance.offset.click=inst.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=$(self).clone().appendTo(this.instance.element).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return ui.helper[0];};event.target=this.instance.currentItem[0];this.instance._mouseCapture(event,true);this.instance._mouseStart(event,true,true);this.instance.offset.click.top=inst.offset.click.top;this.instance.offset.click.left=inst.offset.click.left;this.instance.offset.parent.left-=inst.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=inst.offset.parent.top-this.instance.offset.parent.top;inst._trigger("toSortable",event);inst.dropped=this.instance.element;inst.currentItem=inst.element;this.instance.fromOutside=inst;}
if(this.instance.currentItem)this.instance._mouseDrag(event);}else{if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._trigger('out',event,this.instance._uiHash(this.instance));this.instance._mouseStop(event,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();if(this.instance.placeholder)this.instance.placeholder.remove();inst._trigger("fromSortable",event);inst.dropped=false;}};});}});$.ui.plugin.add("draggable","cursor",{start:function(event,ui){var t=$('body'),o=$(this).data('draggable').options;if(t.css("cursor"))o._cursor=t.css("cursor");t.css("cursor",o.cursor);},stop:function(event,ui){var o=$(this).data('draggable').options;if(o._cursor)$('body').css("cursor",o._cursor);}});$.ui.plugin.add("draggable","iframeFix",{start:function(event,ui){var o=$(this).data('draggable').options;$(o.iframeFix===true?"iframe":o.iframeFix).each(function(){$('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css($(this).offset()).appendTo("body");});},stop:function(event,ui){}});$.ui.plugin.add("draggable","opacity",{start:function(event,ui){var t=$(ui.helper),o=$(this).data('draggable').options;if(t.css("opacity"))o._opacity=t.css("opacity");t.css('opacity',o.opacity);},stop:function(event,ui){var o=$(this).data('draggable').options;if(o._opacity)$(ui.helper).css('opacity',o._opacity);}});$.ui.plugin.add("draggable","scroll",{start:function(event,ui){var i=$(this).data("draggable");if(i.scrollParent[0]!=document&&i.scrollParent[0].tagName!='HTML')i.overflowOffset=i.scrollParent.offset();},drag:function(event,ui){var i=$(this).data("draggable"),o=i.options,scrolled=false;if(i.scrollParent[0]!=document&&i.scrollParent[0].tagName!='HTML'){if(!o.axis||o.axis!='x'){if((i.overflowOffset.top+i.scrollParent[0].offsetHeight)-event.pageY<o.scrollSensitivity)
i.scrollParent[0].scrollTop=scrolled=i.scrollParent[0].scrollTop+o.scrollSpeed;else if(event.pageY-i.overflowOffset.top<o.scrollSensitivity)
i.scrollParent[0].scrollTop=scrolled=i.scrollParent[0].scrollTop-o.scrollSpeed;}
if(!o.axis||o.axis!='y'){if((i.overflowOffset.left+i.scrollParent[0].offsetWidth)-event.pageX<o.scrollSensitivity)
i.scrollParent[0].scrollLeft=scrolled=i.scrollParent[0].scrollLeft+o.scrollSpeed;else if(event.pageX-i.overflowOffset.left<o.scrollSensitivity)
i.scrollParent[0].scrollLeft=scrolled=i.scrollParent[0].scrollLeft-o.scrollSpeed;}}else{if(!o.axis||o.axis!='x'){if(event.pageY-$(document).scrollTop()<o.scrollSensitivity)
scrolled=$(document).scrollTop($(document).scrollTop()-o.scrollSpeed);else if($(window).height()-(event.pageY-$(document).scrollTop())<o.scrollSensitivity)
scrolled=$(document).scrollTop($(document).scrollTop()+o.scrollSpeed);}
if(!o.axis||o.axis!='y'){if(event.pageX-$(document).scrollLeft()<o.scrollSensitivity)
scrolled=$(document).scrollLeft($(document).scrollLeft()-o.scrollSpeed);else if($(window).width()-(event.pageX-$(document).scrollLeft())<o.scrollSensitivity)
scrolled=$(document).scrollLeft($(document).scrollLeft()+o.scrollSpeed);}}
if(scrolled!==false&&$.ui.ddmanager&&!o.dropBehaviour)
$.ui.ddmanager.prepareOffsets(i,event);}});$.ui.plugin.add("draggable","snap",{start:function(event,ui){var i=$(this).data("draggable"),o=i.options;i.snapElements=[];$(o.snap.constructor!=String?(o.snap.items||':data(draggable)'):o.snap).each(function(){var $t=$(this);var $o=$t.offset();if(this!=i.element[0])i.snapElements.push({item:this,width:$t.outerWidth(),height:$t.outerHeight(),top:$o.top,left:$o.left});});},drag:function(event,ui){var inst=$(this).data("draggable"),o=inst.options;var d=o.snapTolerance;var x1=ui.offset.left,x2=x1+inst.helperProportions.width,y1=ui.offset.top,y2=y1+inst.helperProportions.height;for(var i=inst.snapElements.length-1;i>=0;i--){var l=inst.snapElements[i].left,r=l+inst.snapElements[i].width,t=inst.snapElements[i].top,b=t+inst.snapElements[i].height;if(!((l-d<x1&&x1<r+d&&t-d<y1&&y1<b+d)||(l-d<x1&&x1<r+d&&t-d<y2&&y2<b+d)||(l-d<x2&&x2<r+d&&t-d<y1&&y1<b+d)||(l-d<x2&&x2<r+d&&t-d<y2&&y2<b+d))){if(inst.snapElements[i].snapping)(inst.options.snap.release&&inst.options.snap.release.call(inst.element,event,$.extend(inst._uiHash(),{snapItem:inst.snapElements[i].item})));inst.snapElements[i].snapping=false;continue;}
if(o.snapMode!='inner'){var ts=Math.abs(t-y2)<=d;var bs=Math.abs(b-y1)<=d;var ls=Math.abs(l-x2)<=d;var rs=Math.abs(r-x1)<=d;if(ts)ui.position.top=inst._convertPositionTo("relative",{top:t-inst.helperProportions.height,left:0}).top-inst.margins.top;if(bs)ui.position.top=inst._convertPositionTo("relative",{top:b,left:0}).top-inst.margins.top;if(ls)ui.position.left=inst._convertPositionTo("relative",{top:0,left:l-inst.helperProportions.width}).left-inst.margins.left;if(rs)ui.position.left=inst._convertPositionTo("relative",{top:0,left:r}).left-inst.margins.left;}
var first=(ts||bs||ls||rs);if(o.snapMode!='outer'){var ts=Math.abs(t-y1)<=d;var bs=Math.abs(b-y2)<=d;var ls=Math.abs(l-x1)<=d;var rs=Math.abs(r-x2)<=d;if(ts)ui.position.top=inst._convertPositionTo("relative",{top:t,left:0}).top-inst.margins.top;if(bs)ui.position.top=inst._convertPositionTo("relative",{top:b-inst.helperProportions.height,left:0}).top-inst.margins.top;if(ls)ui.position.left=inst._convertPositionTo("relative",{top:0,left:l}).left-inst.margins.left;if(rs)ui.position.left=inst._convertPositionTo("relative",{top:0,left:r-inst.helperProportions.width}).left-inst.margins.left;}
if(!inst.snapElements[i].snapping&&(ts||bs||ls||rs||first))
(inst.options.snap.snap&&inst.options.snap.snap.call(inst.element,event,$.extend(inst._uiHash(),{snapItem:inst.snapElements[i].item})));inst.snapElements[i].snapping=(ts||bs||ls||rs||first);};}});$.ui.plugin.add("draggable","stack",{start:function(event,ui){var o=$(this).data("draggable").options;var group=$.makeArray($(o.stack.group)).sort(function(a,b){return(parseInt($(a).css("zIndex"),10)||o.stack.min)-(parseInt($(b).css("zIndex"),10)||o.stack.min);});$(group).each(function(i){this.style.zIndex=o.stack.min+i;});this[0].style.zIndex=o.stack.min+group.length;}});$.ui.plugin.add("draggable","zIndex",{start:function(event,ui){var t=$(ui.helper),o=$(this).data("draggable").options;if(t.css("zIndex"))o._zIndex=t.css("zIndex");t.css('zIndex',o.zIndex);},stop:function(event,ui){var o=$(this).data("draggable").options;if(o._zIndex)$(ui.helper).css('zIndex',o._zIndex);}});})(jQuery);﻿
var g_images;function DisplayPopUp()
{document.getElementById('popupControlWindow').style.display="";}
function HidePopUp()
{document.getElementById('popupControlWindow').style.display='none';}
function AddLabel()
{document.getElementById('popupControlWindow').style.display="";document.getElementById('popupContent').innerHTML="<TABLE width=\"95%\" cellpadding=\"2\" cellspacing=\"0\" border=\"0\"><TR><TD></br>Label &nbsp;&nbsp;<input type=text name=txtAddLabel></TD></TR></TABLE>";document.getElementById('popupMessage').innerHTML="Click on map to add label";document.getElementById('popupWindowTitle').innerHTML="Add Label";}
function HandleAddMyPointImages(obj)
{g_images=obj;}
function HandleDefaultImage(obj)
{defaultImage=obj;HandleImages();}
function HandleImages()
{var urls=g_images;var innerHTML="<TABLE width=\"95%\" cellpadding=\"2\" cellspacing=\"0\" border=\"0\"><TR><TD colspan=4></br>Label &nbsp;&nbsp;<input type=text name=txtAddLabel></TD></TR>";innerHTML+="<TR><TD colspan=4>Select Icon</TD></TR>";var temp=0;if(urls==null)
{innerHTML="<TR><TD>No images found.</TD></TR></TABLE><BR />";document.getElementById('popupMessage').innerHTML=innerHTML;}
else
{for(i=0;i<urls.length;i++)
{if(i%4==0)
{temp=i;innerHTML+="<TR>";}
innerHTML+="<td nowrap><input type=radio name=imageselector value='"+urls[i]+"' ";if(defaultImage&&defaultImage==urls[i])
{innerHTML+=" checked ";}
innerHTML+="><IMG src='"+urls[i]+"'/></td>";if(i==(temp+4))
{innerHTML+="</TR>";}}
innerHTML+="</TABLE>";document.getElementById('popupContent').innerHTML=innerHTML;document.getElementById('popupMessage').innerHTML="Click on map to add label and image";}}
function SetRedliningMode(mode)
{if(window.autoPostBack)
{document.forms[0].elements['redliningButton'].value=mode;}}
function SetRedliningSymbol()
{return true;}
function SetRedliningDrawProperty()
{if(xmlHttp.readyState==4)
{hideLoading();if(xmlHttp.status==200)
{var responseXMLObj=xmlHttp.responseXML;if(responseXMLObj)
{var lineWidthNode=responseXMLObj.getElementsByTagName("LINEWIDTH");var lineColorNode=responseXMLObj.getElementsByTagName("LINECOLOR");var lineStyleNode=responseXMLObj.getElementsByTagName("LINESTYLE");var fillColorNode=responseXMLObj.getElementsByTagName("FILLCOLOR");var fillOpacityNode=responseXMLObj.getElementsByTagName("FILLOPACITY");var fillTypeNode=responseXMLObj.getElementsByTagName("FILLTYPE");var markerTypeNode=responseXMLObj.getElementsByTagName("MARKERTYPE");var fillcolor;if(lineWidthNode!=null&&lineWidthNode.length>0)
{var temp=lineWidthNode.item(0).text;if(temp!=null&&temp.length>0)
SetLineWidth(temp);}
if(lineColorNode!=null&&lineColorNode.length>0)
{var temp=lineColorNode.item(0).text;if(temp!=null&&temp.length>0)
SetLineColor(temp);}
if(lineStyleNode!=null&&lineStyleNode.length>0)
{var temp=lineStyleNode.item(0).text;if(temp!=null&&temp.length>0)
lineStyle=temp;}
if(fillColorNode!=null&&fillColorNode.length>0)
{fillcolor=fillColorNode.item(0).text;var opacity=0;var fillStyle='Solid';if(fillOpacityNode!=null&&fillOpacityNode.length>0)
{opacity=fillOpacityNode.item(0).text;}
if(fillTypeNode!=null&&fillTypeNode.length>0)
{fillStyle=fillTypeNode.item(0).text;}
if(temp!=null&&temp.length>0)
SetFillStyle(true,temp,opacity,fillStyle)}
if(markerTypeNode!=null&&markerTypeNode.length>0)
{var temp=markerTypeNode.item(0).text;if(temp!=null&&temp.length>0)
{switch(temp)
{case"CIRCLE":case"circle":SetMarkerStyle(fillcolor,PointType.CIRCLE)
break;case"TRIANGLE":case"triangle":SetMarkerStyle(fillcolor,PointType.TRIANGLE)
break;case"STAR":case"star":SetMarkerStyle(fillcolor,PointType.STAR)
break;case"CROSS":case"cross":SetMarkerStyle(fillcolor,PointType.CROSS)
break;case"SQUARE":case"square":SetMarkerStyle(fillcolor,PointType.SQUARE)
break;}}
else
{SetMarkerStyle(fillcolor);}}}}}}
function ShowRedliningEditor(visibleValue)
{var elem=null;var evnt=null;var posX=0,posY=0;if(window.Event)
{evnt=window.Event;elem=evnt.target;posX=evnt.pageX;posY=evnt.PageY;}
else
{evnt=event;elem=event.srcElement;posX=evnt.clientX;posY=evnt.clientY;}
var redLiningEditorElem=document.getElementById("ctrlRedLiningEditor");if(redLiningEditorElem!=null)
{if(visibleValue=='hidden')
{redLiningEditorElem.style.display='none';redLiningEditorElem.style.visibility='hidden';}
else
{redLiningEditorElem.style.pixelLeft=posX;redLiningEditorElem.style.pixelTop=posY;redLiningEditorElem.style.visibility='visible';redLiningEditorElem.style.display='block';}}
return false;}
function RedliningOver()
{if(window.autoPostBack&&window.m_lastActiveToolBar)
{window.m_lastActiveToolBar.Click("ApplyAddRedlining");}}
function GetSelectionShape(id)
{if(!sessionExpired)
{PageMethods.GetObjectGeometry(id,DrawSelectionShape);}
else
{HandleSessionExpired();}}
function DrawSelectionShape(obj)
{hideLoading();if(obj!=null)
{if(obj.error==null)
{var xmlStr=obj;if(xmlStr!=null&&xmlStr.length>0)
{if(isIE)
{objXmlDoc=new ActiveXObject("Msxml2.DOMDocument");objXmlDoc.loadXML(xmlStr);}
else
{objXmlDoc=new DOMParser().parseFromString(xmlStr,"text/xml");}
var geometryNode=objXmlDoc.getElementsByTagName("GEOMETRY");if(geometryNode!=null&&geometryNode.length>0)
{DrawShapesFromXml(geometryNode);try
{if(document.getElementById(_VertexToolbarPan)!=null)
{if(window.ShowLayer)
{ShowLayer(_VertexToolbarPan,null,null);}
else
{document.getElementById(_VertexToolbarPan).style.display='block';}}}
catch(e){}
HideToolBar('EDITING_VERTEX_TOOLS');ShowToolBar('VERTEX_TOOLS');}
else
{var errorNode=objXmlDoc.getElementsByTagName("ERROR");if(errorNode!=null&&errorNode.length>0)
{var message=errorNode.item(0).getAttribute("message");if(message!=null&&message.length>0)
{alert(message);}}}}}
else
{alert("Error from server :\n"+obj.error);}}
else
alert("Server not responding, Please try later");}
function DrawShapesFromXml(geometryNodes,mapCtrlId)
{var mapCtrl=GetMapCtrl(mapCtrlId);if(geometryNodes!=null&&geometryNodes.length>0)
{var shapeNodes=geometryNodes.item(0).getElementsByTagName("SHAPE");if(shapeNodes)
{var shapeType=null;var partNodes=null;var value=null;var points=[];var linearRing=null;var drawFeatures=[];for(i=0;i<shapeNodes.length;i++)
{shapeType=shapeNodes.item(i).getAttribute("type");partNodes=shapeNodes.item(i).getElementsByTagName("PART");for(j=0;j<partNodes.length;j++)
{value=partNodes.item(j).getAttribute("coords");points=_GetOLPointsArray(value);if(shapeType=="LINE"||shapeType=="POLYLINE")
{drawFeatures.push(new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LineString(points)));}
else
{linearRing=new OpenLayers.Geometry.LinearRing(points);drawFeatures.push(new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon([linearRing])));}}
mapCtrl.StartModifyFeatures(drawFeatures);}}}}
function _GetOLPointsArray(pixelsList)
{var points=[];var pixel=null;if(pixelsList)
{var pts=eval("new Array("+pixelsList+")");var n=pts.length;for(i=0;i<n;i=i+2)
{pixel=new OpenLayers.Pixel(parseInt(pts[i]),parseInt(pts[i+1]));points.push(CovertPixelToPoint(pixel));}}
return points;}
function ApplyVertexEdit(mapCtrlId)
{if(!sessionExpired)
{if(currentRedlineShapeId)
{var mapCtrl=GetMapCtrl(mapCtrlId);var features=mapCtrl.GetModifyFeatures();var feature=features[0].geometry;var pointsStr='';if(feature!=null)
{switch(feature.CLASS_NAME)
{case'OpenLayers.Geometry.LineString':pointsStr=_GetPointsStrFromGeometry(feature);break;case'OpenLayers.Geometry.Polygon':for(var j=0;j<feature.components.length;j++)
{pointsStr=_GetPointsStrFromGeometry(feature.components[j]);}
break;}
if(pointsStr!='')
{PageMethods.ApplyAddVertex(pointsStr,currentRedlineShapeId,onAddVertex);}}}
else
{alert("Selection is null.");}}
else
{HandleSessionExpired();}}
function _GetPointsStrFromGeometry(geometry)
{var pointsStr="";switch(geometry.CLASS_NAME)
{case'OpenLayers.Geometry.LineString':numPoints=geometry.components.length;break;case'OpenLayers.Geometry.LinearRing':numPoints=geometry.components.length-1;break;}
for(var i=0;i<numPoints;i++)
{if(i>0)pointsStr+=",";var tempPixel=ConvertPointToPixel(geometry.components[i]);pointsStr+=tempPixel.x+','+tempPixel.y;}
return pointsStr;}
function onAddVertex(resp,mapCtrlId)
{var mapCtrl=GetMapCtrl(mapCtrlId);mapCtrl.RefreshMap();HideLayer(_VertexToolbarPan);ClickTool('ZoomIn');}
function ModeAddRedliningPolygon(feature)
{CurrentRedliningMode('AddRedliningPolygon',feature);}
function ModeAddRedliningPoint(feature)
{CurrentRedliningMode('AddRedliningPoint',feature);}
function ModeAddRedliningLine(feature)
{CurrentRedliningMode('AddRedliningLine',feature);}
function ModeAddRedliningPolyLine(feature)
{CurrentRedliningMode('AddRedliningPolyLine',feature);}
function ModeAddRedliningCircle(feature)
{CurrentRedliningMode('AddRedliningPolygon',feature);}
function ModeAddRedliningRectangle(feature)
{CurrentRedliningMode('AddRedliningPolygon',feature);}
function CurrentRedliningMode(mode,features,mapCtrlId)
{var mapCtrl=GetMapCtrl(mapCtrlId);SetGeneralCallBackSetting(features);document.forms[0].__EVENTTARGET.value="tb_REDLININGTOOLS_APPLY";document.forms[0].elements['redliningMode'].value="true";if(window.autoPostBack)
{document.forms[0].elements['redliningButton'].value=mode;__doPostBack(document.forms[0].__EVENTTARGET.value);}}
var currentRedlineShapeId;function EditRedliningVertex(id,itemId)
{currentRedlineShapeId=itemId;GetSelectionShape(itemId);}
function SetRedliningTool(toolName)
{document.forms[0].elements['redliningTool'].value=toolName;}
function openRetrieveRedliningPopup(onPointVirtualDir)
{if(!sessionExpired)
{HandleRetriveSelectionFrame(onPointVirtualDir+'?CMD=RetrieveRedlining');}
else
{HandleSessionExpired();}}
var currentIndexList=new Array();var hasChildrenFlag=new Array();var isNav=(window.navigator.appName.toLowerCase().indexOf("netscape")>=0);var isIE=(window.navigator.appName.toLowerCase().indexOf("microsoft")>=0);var isIE5=(navigator.appVersion.indexOf("MSIE 5.01")>0);var MAX_COL_SPAN=50;var HIDDEN_ALL_FEATURE_PREFIX="hidden_all_";var HIDDEN_SELECTED_FEATURE_PREFIX="hidden_selected_";var HIDDEN_XSL_DIR="hidden_xsl_dir";var CURRENT_TASK_ID="currentTaskId";var CURRENT_SEARCH_ID="currentSearchId";var CURRENT_FEATURE_ID="currentFeatureId";var CURRENT_SELECTION_ID="currentSelectionId";var HIDDEN_COL_IMG="colImg";var HIDDEN_EXP_IMG="expImg";var __currentSearchId=0;var __currentSelectionSetId=0;if(typeof __activeSelectionSetId=='undefined')
var __activeSelectionSetId=0;var __currentPage=0;var __showSelections=false;var __navLinkClientJS;var hideLinkedData;var linkedDataId;var pageDataCount=0;var loopCount=0;var pageIndex=0;var prevPageIndex=0;var LINK_POST_BACK=2;var NavigationControl={callback_MoveTo:function(searchId,index,joinId)
{ResultsPage_ApplySelections(false);if(!sessionExpired)
{PageMethods.MoveTo(searchId,index,ViewStateControl.getXslDir(),__showSelections,this.refreshSearchResult);pageIndex=index;linkedDataId=joinId;}
else
{HandleSessionExpired();}},callback_MoveLast:function(searchId,totalCount)
{ResultsPage_ApplySelections(false);if(!sessionExpired)
{var currentIndex=CurrentIndexUtil.getCurrentIndex(searchId);if(currentIndex<totalCount-1)
PageMethods.MoveLast(searchId,ViewStateControl.getXslDir(),__showSelections,this.refreshSearchResult);else
HideLoading();}
else
{HandleSessionExpired();}},callback_MoveFirst:function(searchId)
{ResultsPage_ApplySelections(false);if(!sessionExpired)
{var currentIndex=CurrentIndexUtil.getCurrentIndex(searchId);if(currentIndex>0)
PageMethods.MoveFirst(searchId,ViewStateControl.getXslDir(),__showSelections,this.refreshSearchResult);else
HideLoading();}
else
{HandleSessionExpired();}},callback_MoveFastForward:function(searchId,totalCount)
{ResultsPage_ApplySelections(false);if(!sessionExpired)
{var currentIndex=CurrentIndexUtil.getCurrentIndex(searchId);if(currentIndex<totalCount-1)
PageMethods.MoveFastForward(searchId,currentIndex,ViewStateControl.getXslDir(),__showSelections,this.refreshSearchResult);else
HideLoading();}
else
{HandleSessionExpired();}},callback_MoveFastBackward:function(searchId,totalCount)
{ResultsPage_ApplySelections(false);if(!sessionExpired)
{var currentIndex=CurrentIndexUtil.getCurrentIndex(searchId);if(currentIndex>0)
PageMethods.MoveFastBackward(searchId,currentIndex,ViewStateControl.getXslDir(),__showSelections,this.refreshSearchResult);else
HideLoading();}
else
{HandleSessionExpired();}},callback_ApplySorting:function(searchId,columnId,columnName)
{ResultsPage_ApplySelections(false);var currentIndex=CurrentIndexUtil.getCurrentIndex(searchId);if(currentIndex<0)
currentIndex=0;var chk=document.getElementById("chk_sort_"+searchId);var sortAllPages=false;if(chk!=null)
{if(chk.value=='true')
sortAllPages=true;}
var sortOrder=null;var radSortOrder=document.getElementById("radSortOrder_"+searchId);if(radSortOrder!=null)
{if(radSortOrder.checked)
sortOrder='ASCENDING';else
sortOrder='DESCENDING';}
if(!sessionExpired)
{PageMethods.GetSortedSearchResult(searchId,columnId,columnName,currentIndex,sortOrder,sortAllPages,ViewStateControl.getXslDir(),__showSelections,this.refreshSearchResult);}
else
{HandleSessionExpired();}},refreshSearchResult:function(response)
{var data=response;if(data!=null)
{ShowLoading();var currentIndex=data.CurrentIndex;CurrentIndexUtil.setCurrentIndex(data.SearchId,currentIndex);__currentSearchId=data.SearchId;__currentPage=currentIndex;if(data.SearchId!=null&&data.FeatureList!=null)
{parentNode=document.getElementById(data.SearchId);if(parentNode!=null)
{parentNode.innerHTML=data.FeatureList;}
parentNode=document.getElementById("div_"+data.SearchId);if(parentNode!=null)
{parentNode.innerHTML=data.NavigationBar;}
var searchId=data.SearchId;MapItControl.setMapItCheckBox(searchId);if(__showSelections)
{if(__activeSelectionSetId==data.SearchId)
{RefreshMap();}
if(__navLinkClientJS!=null)
{eval(__navLinkClientJS);}}}
HideLoading();}}}
var MapItControl={GetselectedItem:function(ctrl){var mapextent=true;var Checkboxctrl=document.getElementById('box_'+ctrl);if(Checkboxctrl!=null){if(Checkboxctrl.checked){mapextent=true;}
else{mapextent=false;}}
else{mapextent=true;}
var controlchecbox=document.getElementById("Attribute_"+ctrl);if(controlchecbox!=null){var dropdownid=controlchecbox.options[controlchecbox.selectedIndex].value;var dropdowntext1=controlchecbox.options[controlchecbox.selectedIndex].text;var dropdowntext=dropdowntext1.replace("--","")
PageMethods.SetSearchResult(dropdownid,dropdowntext,mapextent);}},selectedItem:function(ctrl){var control=document.getElementById("Attribute_"+ctrl);if(control!=null){var dropdowntext1=control.options[control.selectedIndex].text;var dropdowntext=dropdowntext1.replace("--","")
var dropdownid=control.options[control.selectedIndex].value;var Checkboxctrl=document.getElementById('box_'+ctrl);if(Checkboxctrl){Checkboxctrl.checked=true;}
PageMethods.SetSearchResult(dropdownid,dropdowntext,true);}},RemoveFilter:function(ctrl){var allowremove=false;jQuery:jConfirm(_removeFiltermessage,_alertWindowTitle,window._OKText,window._CancelText,function(r){if(r){var control=document.getElementById("Attribute_"+ctrl);if(control!=null){var dropdowntext1=control.options[control.selectedIndex].text;var dropdowntext=dropdowntext1.replace("--","")
var dropdownid=control.options[control.selectedIndex].value;PageMethods.SetSearchResult(dropdownid,dropdowntext,true,MapItControl.Refreshwindow);}}});},RefreshFromAdvanceToolFundy:function(){try{ShowLayer(_SearchLayer,null,null);var date_object=new Date();var url=NGServerUrl()+"/Webpages/Search/FundySearch.aspx?DISPLAYRESULTS=true&uniqueid="+date_object.getTime()
var iframeElem=document.getElementById(_SearchIframe);iframeElem.setAttribute('isLoaded','true');var eleWidth=null;var eleHeight=null;if(iframeElem.getAttribute('OriginalWidth')!=null&&typeof iframeElem.getAttribute('OriginalWidth')!='undefined')
eleWidth=iframeElem.getAttribute('OriginalWidth');else if(document.getElementById(_SearchLayer)!=null&&document.getElementById(_SearchLayer).getAttribute('OriginalWidth')!=null)
eleWidth=document.getElementById(_SearchLayer).getAttribute('OriginalWidth');if(iframeElem.getAttribute('OriginalHeight')!=null&&typeof iframeElem.getAttribute('OriginalHeight')!='undefined')
eleHeight=iframeElem.getAttribute('OriginalHeight');else if(document.getElementById(_SearchLayer)!=null&&document.getElementById(_SearchLayer).getAttribute('OriginalHeight')!=null)
eleHeight=document.getElementById(_SearchLayer).getAttribute('OriginalHeight');PopulateiFrame(_SearchIframe,url,eleWidth,eleHeight);var innerRowElem=document.getElementById("Inner_"+_SearchLayer);innerRowElem.style.display="none";ResetSearchWindow(false);}
catch(e){alert('ExceptionHandler::'+e);}},Refreshwindow:function(){try{if((this.parent)&&(this.parent.frames)&&(this.parent.frames['fundySearchiFrame'])){var url=NGServerUrl()+"/Webpages/Search/FundySearch.aspx?DISPLAYRESULTS=true"
this.parent.frames['fundySearchiFrame'].location=url;;}
else{if(__showSelections){RefreshUI(true);}
else{UpdatePanel('Search_Result');}}}
catch(e){alert('ExceptionHandler::'+e);}},Refreshwindowfilter:function(){try{if(__showSelections){RefreshUI(true);}
else{UpdatePanel('Search_Result');}}
catch(e){alert('ExceptionHandler::'+e);}},RefreshwindowSelection:function(){},applySorting:function(searchid,ctrColumn){var ddlColumns=document.getElementById(ctrColumn);if(ddlColumns!=null){var columnName=ddlColumns.options[ddlColumns.selectedIndex].text;var columnId=ddlColumns.options[ddlColumns.selectedIndex].value;NavigationControl.callback_ApplySorting(searchid,columnId,columnName);}},setMapItCheckBox:function(searchId){if(searchId!=null){var featureIdArray;var allFeaturesNode=document.getElementById(HIDDEN_ALL_FEATURE_PREFIX+searchId);if(allFeaturesNode!=null){featureIdArray=allFeaturesNode.value.split("#");for(var i=0;i<featureIdArray.length;i++){var checkBoxNode=document.getElementById("map_"+searchId+"_"+featureIdArray[i]);if(checkBoxNode!=null){checkBoxNode.checked=false;}}}
selectedFeaturesdNode=document.getElementById(HIDDEN_SELECTED_FEATURE_PREFIX+searchId);if(selectedFeaturesdNode!=null){featureIdArray=selectedFeaturesdNode.value.split("#");for(var i=0;i<featureIdArray.length;i++){var checkBoxNode=document.getElementById("map_"+searchId+"_"+featureIdArray[i]);if(checkBoxNode!=null){checkBoxNode.checked=true;}}}
MapItControl.setCheckAllBox(searchId);UpdateSelectionsAndSearchResultSetMapping(searchId);}},setCheckAllBox:function(searchId){var chk=document.getElementById("chk_map_"+searchId);if(chk){if(MapItControl.isAllChecked(searchId)){chk.checked=true;}
else
chk.checked=false;}},setFeatureId:function(node,searchId,featureId){if(node!=null){MapItControl.setSelectedFeatureId(node,searchId,featureId);var chk=document.getElementById("chk_map_"+searchId);if(chk){if(MapItControl.isAllChecked(searchId))
chk.checked=true;else
chk.checked=false;}}
UpdateSelectionsAndSearchResultSetMapping(searchId);},setSelectedFeatureId:function(node,searchId,featureId){if(node!=null){var selectedFeatures=document.getElementById(HIDDEN_SELECTED_FEATURE_PREFIX+searchId);if(selectedFeatures){var checkBoxBuffer=selectedFeatures.value;if(node.checked){if(!MapItControl.contains(checkBoxBuffer,featureId,'#'))
checkBoxBuffer+=featureId+"#";}
else{if(MapItControl.contains(checkBoxBuffer,featureId,'#'))
checkBoxBuffer=MapItControl.removeItem(checkBoxBuffer,featureId,'#');}
selectedFeatures.value=checkBoxBuffer;}}},contains:function(collection,item,splitChar){var contained=false;var itemArray=collection.split(splitChar);for(var i=0;i<itemArray.length;i++){if(itemArray[i]==item){contained=true;break;}}
return contained;},removeItem:function(collection,item,splitChar){var returnCollection="";var itemArray=collection.split(splitChar);for(var i=0;i<itemArray.length;i++){if(itemArray[i]!=''&&itemArray[i]!=item)
returnCollection+=itemArray[i]+splitChar;}
return returnCollection;},toggleCheckBoxonAllPages:function(searchId,switchFlag){var allFeaturesNode=document.getElementById(HIDDEN_ALL_FEATURE_PREFIX+searchId);var selectedFeaturesdNode=document.getElementById(HIDDEN_SELECTED_FEATURE_PREFIX+searchId);if(allFeaturesNode!=null&&selectedFeaturesdNode!=null){featureIdArray=selectedFeaturesdNode.value.split("#");if(switchFlag)
selectedFeaturesdNode.value=allFeaturesNode.value;else
selectedFeaturesdNode.value="";var selectAllChk=document.getElementById("chk_map_"+searchId);if(selectAllChk)
selectAllChk.checked=switchFlag;MapItControl.setAllCheckBoxes(searchId,switchFlag);HideLayer(_BoxSelectionTools,null,null);}},toggleCheckBox:function(ctrCheckBox,searchId){if(ctrCheckBox.checked){MapItControl.toggleCheckBoxonAllPages(searchId,true);}
else{MapItControl.toggleCheckBoxonAllPages(searchId,false);}},setAllCheckBoxes:function(searchId,state){var allFeatureNode=document.getElementById(HIDDEN_ALL_FEATURE_PREFIX+searchId);if(allFeatureNode){if(allFeatureNode.value){if(state!=null){var featureIdArray=allFeatureNode.value.split("#");for(var i=0;i<featureIdArray.length;i++){var checkBoxNode=document.getElementById("map_"+searchId+"_"+featureIdArray[i]);if(checkBoxNode!=null){checkBoxNode.checked=state;MapItControl.setSelectedFeatureId(checkBoxNode,searchId,featureIdArray[i]);}}}}
UpdateSelectionsAndSearchResultSetMapping(searchId);}},isAllChecked:function(searchId){var isSame=true;var allFeaturesNode=document.getElementById(HIDDEN_ALL_FEATURE_PREFIX+searchId);if(allFeaturesNode){var featureIdArray=allFeaturesNode.value.split("#");for(var i=0;i<featureIdArray.length;i++){var checkBoxNode=document.getElementById("map_"+searchId+"_"+featureIdArray[i]);if(checkBoxNode!=null){if(!checkBoxNode.checked){isSame=false;break;}}}}
return isSame;},isNoneChecked:function(searchId){var isSame=true;var selectedFeaturesNode=document.getElementById(HIDDEN_SELECTED_FEATURE_PREFIX+searchId);if(selectedFeaturesNode){var featureIndexArray=selectedFeaturesNode.value.split("#");if(featureIndexArray.length>1)
isSame=false;}
return isSame;},redirect:function(selectId,cmd){if(MapItControl.isNoneChecked(selectId))
alert("Please select feature(s) to map it");else{var selectedFeatureNode=document.getElementById(HIDDEN_SELECTED_FEATURE_PREFIX+selectId);if(selectedFeatureNode!=null){var taskNode=document.getElementById(CURRENT_TASK_ID);var searchIdNode=document.getElementById(CURRENT_SEARCH_ID);if(taskNode!=null&&searchIdNode!=null){taskNode.value=cmd;searchIdNode.value=selectId;MapItControl.postBack();taskNode.value=null;}}}},chart:function(selectId,cmd){if(MapItControl.isNoneChecked(selectId))
alert("Please select feature(s) to Chart.");else{var selectedFeatureNode=document.getElementById(HIDDEN_SELECTED_FEATURE_PREFIX+selectId);if(selectedFeatureNode!=null){var taskNode=document.getElementById(CURRENT_TASK_ID);var searchIdNode=document.getElementById(CURRENT_SEARCH_ID);if(taskNode!=null&&searchIdNode!=null){taskNode.value=cmd;searchIdNode.value=selectId;MapItControl.postBack();taskNode.value=null;}}}},postBack:function(){var formNodes=document.getElementsByTagName("form");var formNode=null;if(formNodes!=null&&formNodes.length>0){formNode=formNodes[0];if(formNode!=null){UpdatePanel('MapResultonMapControl|Map|SelectionListContainer|MapScalePicker');}}}}
var JoinControl={callback_Join:function(node,searchId,rootFeatureId,originRowId,joinId,invisiblejoinid)
{if(node!=null)
{if(!sessionExpired)
{if(!this.hasPostBack(node.id))
{PageMethods.GetHtmlForEachJoin(node.id,searchId,rootFeatureId,originRowId,joinId,invisiblejoinid,ViewStateControl.getXslDir(),__showSelections,this.getJoinRows);}
else
this.toggleChildren(node,originRowId,joinId);}
else
{HandleSessionExpired();}}},toggleJoinDetails:function(searchId,joinId,checked)
{if(checked!=null)
hideLinkedData=checked;else
{var checkbox=document.getElementById("chk_hideData_"+searchId);hideLinkedData=checkbox.checked;checked=hideLinkedData;}
if(joinId!=null)
linkedDataId=joinId;else
joinId=linkedDataId;var allFeaturesNode=document.getElementById(HIDDEN_ALL_FEATURE_PREFIX+searchId);var featureIdArray=allFeaturesNode.value.split("#");if(pageDataCount==0&&loopCount==0)
{pageDataCount=0;loopCount=20;}
if(prevPageIndex>pageIndex)
{for(var i=pageIndex;i<prevPageIndex;i++)
{loopCount=loopCount-20;pageDataCount=pageDataCount-20;}}
else if(prevPageIndex<pageIndex)
{for(var j=prevPageIndex;j<pageIndex;j++)
{pageDataCount=pageDataCount+20;loopCount=loopCount+20;}}
if(featureIdArray.length<21)
loopCount=featureIdArray.length-1;for(var i=pageDataCount;i<loopCount;i++)
{var featureId=featureIdArray[i];var nodeId="join_"+searchId+"_"+featureId+"_"+featureId+"_"+joinId;var trId="tr_"+searchId+"_"+featureId+"_"+featureId+"_"+joinId;var row=document.getElementById(trId);if(!checked)
{row.style.display='';PageMethods.GetHtmlForEachJoin(nodeId,searchId,featureId,featureId,joinId,"",ViewStateControl.getXslDir(),__showSelections,this.getJoinRows);}
else
{if(row!=null)
{row.style.display='none';if(row.nextSibling!=null)
{row.nextSibling.style.display='none';}}}}
prevPageIndex=pageIndex;},getJoinRows:function(response)
{var data=response;if(data!=null)
{var joinedNode=document.getElementById(data.CurrentNodeId);if(joinedNode!=null)
{var htmlString=data.FeatureList;if(htmlString!=null)
htmlString=StringUtil.trim(htmlString);if(htmlString!=null&&htmlString!="")
{JoinControl.setChildrenFlag(data.FeatureId,data.JoinId);var trNode=joinedNode.parentNode.parentNode;var tbodyNode=trNode.parentNode;var tr=document.createElement("TR");var td=document.createElement("TD");var div=document.createElement("DIV");div.setAttribute("align","left");div.innerHTML=htmlString;td.appendChild(div);td.setAttribute("colSpan",MAX_COL_SPAN);tr.appendChild(td);tr.id="tr_"+data.CurrentNodeId;if(trNode.nextSibling==null)
tbodyNode.appendChild(tr);else
tbodyNode.insertBefore(tr,trNode.nextSibling);joinedNode.value=StringUtil.changeToMinusSign(joinedNode);}}}},setChildrenFlag:function(originRowId,joinId)
{if(originRowId!=null)
{hasChildrenFlag[hasChildrenFlag.length]=originRowId+"_"+joinId;}},hasPostBack:function(joinNodeId)
{var postBack=false;if(document.getElementById("tr_"+joinNodeId))
postBack=true;return postBack;},hasChildren:function(originRowId,joinId)
{var has=false;if(originRowId!=null)
{for(var i=0;i<hasChildrenFlag.length;i++)
{if(hasChildrenFlag[i]==originRowId+"_"+joinId)
{has=true;break;}}}
return has;},toggleChildren:function(joinNode,featureId,joinId)
{if(joinNode!=null)
{if(JoinControl.hasChildren(featureId,joinId))
{var trElem=joinNode.parentNode.parentNode;if(trElem!=null)
{var trNodeSibling=trElem.nextSibling;if(trNodeSibling!=null)
{if(trNodeSibling.style.display=="inline"||trNodeSibling.style.display=="block"||trNodeSibling.style.display=="")
{trNodeSibling.style.display="none";joinNode.value=StringUtil.changeToPlusSign(joinNode);}
else
{joinNode.value=StringUtil.changeToMinusSign(joinNode);trNodeSibling.style.display="";}}}}}}}
var StringUtil={trim:function(str)
{return str.replace(/^\s*|\s*$/g,"");},changeToMinusSign:function(joinNode)
{if(joinNode)
{var img=document.getElementById(HIDDEN_EXP_IMG);if(img)
joinNode.src=img.value;}},changeToPlusSign:function(joinNode)
{if(joinNode)
{var img=document.getElementById(HIDDEN_COL_IMG);if(img)
joinNode.src=img.value;}}}
var CurrentIndexUtil={setCurrentIndex:function(searchId,currentIndex)
{if(searchId!=null&&currentIndex!=null)
{this.removePair(searchId);var position=this.getEmptyPosition();if(position==-1)
position=0;currentIndexList[position]=new Array(searchId,currentIndex);}},getCurrentIndex:function(searchId)
{var index=-1;if(searchId!=null)
{for(var i=0;i<currentIndexList.length;i++)
{if(currentIndexList[i]!=null&&currentIndexList[i][0]!=null&&currentIndexList[i][0]==searchId)
{index=currentIndexList[i][1];break;}}}
return index;},removePair:function(searchId)
{if(searchId!=null)
{var compare=true;for(var i=0;i<currentIndexList.length;i++)
{if(compare)
{if(currentIndexList[i][0]==searchId)
{if(i<currentIndexList.length-1)
{currentIndexList[i][0]=currentIndexList[i+1][0];currentIndexList[i][1]=currentIndexList[i+1][1];}
compare=false;}}
else
{currentIndexList[i][0]=currentIndexList[i+1][0];currentIndexList[i][1]=currentIndexList[i+1][1];}}
if(!compare)
{var position=currentIndexList.length-1;if(position>=0)
{currentIndexList[position][0]=null;currentIndexList[position][1]=null;currentIndexList[position]=null;}}}},getEmptyPosition:function()
{var index=-1;for(var i=0;i<currentIndexList.length;i++)
{if(currentIndexList[i]==null)
{index=i;break;}}
return index;}}
var ViewStateControl={getXslDir:function()
{var node=document.getElementById(HIDDEN_XSL_DIR);if(node!=null)
return node.value;}}
var LinkControl={linkPostBack:function(searchId,featureId,selectionItemId)
{var taskNode=document.getElementById(CURRENT_TASK_ID);var featureIdNode=document.getElementById(CURRENT_FEATURE_ID);var searchIdNode=document.getElementById(CURRENT_SEARCH_ID);var selectionIdNode=document.getElementById(CURRENT_SELECTION_ID);if(taskNode!=null&&featureIdNode!=null&&searchIdNode!=null&&selectionIdNode!=null)
{taskNode.value=LINK_POST_BACK;featureIdNode.value=featureId;searchIdNode.value=searchId;selectionIdNode.value=selectionItemId;UnSelectAllTools();MapItControl.postBack();}},navigation:function(target,targetUrl,queryParameter)
{var url=targetUrl+"?"+queryParameter
if(target=='_new')
window.open(url,target);else
location.replace(url);}}
var HeaderNavigationControl={MoveNext:function(selectedId)
{if(!sessionExpired)
{PageMethods.MoveNext(selectedId,MapItControl.Refreshwindow);}
else
{HandleSessionExpired();}},MoveNextSelection:function(selectedId)
{if(!sessionExpired)
{PageMethods.MoveNextSelect(selectedId,MapItControl.RefreshwindowSelection);}
else
{HandleSessionExpired();}},MovePrevious:function(selectedId)
{if(!sessionExpired)
{PageMethods.MovePrevious(selectedId,MapItControl.Refreshwindow);}
else
{HandleSessionExpired();}}}
function ViewReports(searchId)
{if(searchId!=null)
{var url='/Webpages/Reports/Reports.aspx?FUNCTIONALITY=RESULTS&SEARCHID='+searchId;if(window.NGServerUrl)
{url=NGServerUrl()+url;}
if(window.HandleReportsFrame)
{HandleReportsFrame(url);}
else
{var reportWindow=window.open(url,"reportWin"+(window.__sessionUniqueId?__sessionUniqueId:""),"toolbar=no, directories=no, location=no, status=yes, menubar=no, resizable=yes, scrollbars=yes, width=400, height=200");}}}
function SetSelectionParameter(selectionSetId,pageIndex,showSelections,activeSelectionSetId,navLinkClientJS)
{__currentSelectionSetId=selectionSetId;__currentPage=pageIndex;__showSelections=showSelections;__activeSelectionSetId=activeSelectionSetId;__navLinkClientJS=navLinkClientJS;currentIndexList=new Array();}
function SetSearchParameter(searchId,pageIndex)
{__currentSearchId=searchId;__currentPage=pageIndex;currentIndexList=new Array();}
function ShowResultInfoWindow(featureId,infoLayerId,InfoSearchId)
{var path="/Webpages/Info/Info.aspx";if(window.NGServerUrl)
{path=NGServerUrl()+path;}
else
{var protocol=window.location.protocol;var theHost=window.location.hostname;var port=window.location.port;if(port)
{port=":"+port;}
var ThePath=window.location.pathname;ThePath=ThePath.substring(0,ThePath.indexOf("/",1));path=protocol+"//"+theHost+port+ThePath+path;}
var infoUrl=path+"?FID="+featureId+"&INFOLAYERID="+infoLayerId+"&INFOSEARCHID="+InfoSearchId;window.open(infoUrl,"InfoWindow","toolbar=no, directories=no, location=no,status=yes, menubar=no, resizable=yes, scrollbars=yes, width=550, height=500");}
function ViewChart(searchid)
{var featureIdArray;var selectedFeaturesdNode=NgGetElementById(HIDDEN_SELECTED_FEATURE_PREFIX+searchid);if(selectedFeaturesdNode!=null)
{featureIdArray=selectedFeaturesdNode.value.split("#");}
if(MapItControl.isNoneChecked(searchid))
alert("Please select feature(s) to Chart.");else
{P
