//START ESRI.ArcGIS.ADF.Web.UI.WebControls.Runtime.JavaScript.display_common.js
/*
COPYRIGHT 1995-2005 ESRI

TRADE SECRETS: ESRI PROPRIETARY AND CONFIDENTIAL
Unpublished material - all rights reserved under the 
Copyright Laws of the United States.

For additional information, contact:
Environmental Systems Research Institute, Inc.
Attn: Contracts Dept
380 New York Street
Redlands, California, USA 92373


email: contracts@esri.com
*/


//////////////////////// Common global variables ////////////////////////

// setup test for browser
var isNav = (window.navigator.appName.toLowerCase().indexOf("netscape")>=0);
var isIE = (Sys.Browser.agent == Sys.Browser.InternetExplorer)
var userAgent = navigator.userAgent;
var navType = "IE";
var nav70 = false;
var nav8 = false;
// get flavor of browser
switch(Sys.Browser.agent) {
	case Sys.Browser.InternetExplorer: 'IE'; break;
	case Sys.Browser.Firefox: navType = 'FireFox'; break;
	case Sys.Browser.Safari: navType = 'Safari'; break;
	case Sys.Browser.Opera: navType = 'Opera'; break;
	default: navType = 'Mozilla'; break;
}

// if IE, check for major versions
if (Sys.Browser.agent == Sys.Browser.InternetExplorer) {
    var ieVersion = Sys.Browser.version;
}

var doc = document;
var defaultImagePath = "/aspnet_client/ESRI/WebADF/images/";
var defaultStylePath = "/aspnet_client/ESRI/WebADF/styles/";
var esriBlankImagePath = "/aspnet_client/ESRI/WebADF/images/blank.gif";

// current coords
var mouseX = 0;
var mouseY = 0;

// saved zoom box coords
var x1 = 0;
var y1 = 0;
var x2 = 0;
var y2 = 0;
var x3 = 0;
var y3 = 0;
var lastX = 0;
var lastY = 0;

// zoom box variables
var zleft = 0;
var ztop = 0;
var zright = 0;
var zbottom = 0;

// obj's for Form Identifier
var docFormID = 0;

var leftButton =1;
var rightButton = 2;
if (isNav) {
	leftButton = 1;
	rightButton = 3;
}

var Maps = [];
var MapNames = [];
var map = null;
var lastmap = null;
var page = null;
var lastpage = null;
var pagemap = null;
var lastpagemap = null;
var mapCount = 0;
var pageCount = 0;
var dragbox = null;

var promptString = "";
var savedCursor = "pointer";

var eLeft = 0;
var eTop = 0;
var eWidth = 0;
var eHeight = 0;

var xMove = 0;
var yMove = 0;

var mapCount = 0;

var jumpToFinish = false;

var coordString = "";
//var statusString = "";
var controlType = "Map";

var Overviews = new Array();
var OverviewNames = new Array();
var ovCount = 0;
var ov = null;

//var Toolbars = new Array();
//var ToolbarGroups = new Array();
//var ToolbarName = new Array();

var Tocs = [];
var TocNames = [];

// popup window objects
var mapWindow = null;
var ovWindow = null;
var tocWindow = null;
var toolWindow = null;
var pageWindow = null;

// maptips objects
var MapTipCollections = [];
var MapTipCollectionNames = [];
var maptipHoverPanel = null;
var maptipExtendedPanels = [];
var maptips = null;
var maptip = null;
var mt_manager = null;
var maptipsActive = false;

var tempMouseMove = null;
var tempMouseUp = null;
var tempContent = "";
var tempStyle = "";

// dynamic stylesheet
var m_StyleSheet = null;
var m_ajaxMethodPrefix = "";
var m_ajaxMethods = null;

var callBackFunctionString = "";
var tileCallbackFunctionString = "";
if (identifyCallbackFunctionString==null)
    var identifyCallbackFunctionString = "";
if (overviewCallbackFunctionString==null)
    var overviewCallbackFunctionString = "";
if (vectorCallbackFunctionString==null)
    var vectorCallbackFunctionString = "";
var hasZoomLevel = false;
var webPageIsLoaded = false;

var commonCallbackFree = true;
var shiftPressed = false;
var ctrlPressed = false;
var altPressed = false;

var esriJavaScriptDecimalDelimiter = ((("theChar is" + (10/100)).indexOf("."))==-1) ? "," : "."; // get decimal delimiter used by JavaScript on user machine
if (typeof(esriSystemDecimalDelimiter)=="undefined") 
    esriSystemDecimalDelimiter = esriJavaScriptDecimalDelimiter;

function createLayer(name, inLeft, inTop, width, height, visible, content, classname, style, container) {
	var oStyle = 'position:absolute; overflow:hidden; left:' + inLeft + 'px; top:' + inTop + 'px; width:' + width + 'px; height:' + height + 'px;' + '  visibility:' + (visible ? 'visible;' : 'hidden;');
	var s = '<div id="' + name + '" style=" position:absolute; overflow:hidden; left:' + inLeft + 'px; top:' + inTop + 'px; width:' + width + 'px; height:' + height + 'px;' + '  visibility:' + (visible ? 'visible;' : 'hidden;');
	if (style!=null)  s += style;
	s += '"';
	if ((classname!=null) && (classname!=""))  s += ' class="' + classname + '"';
	s += '>';
	//s += content;
	//s += '</div>';
	if (container!=null) {
		var contObj = document.getElementById(container);
		contObj.innerHTML = s + content + '</div>';
	} else {
		//alert(s);
		var oDiv = document.createElement("div");
		oDiv.id = name;
		if (style!=null) oStyle += ";" + style;
		oDiv.style.cssText += oStyle;
		if (classname!=null) oDiv.className = classname;
		
		dragObj.innerHTML = content;
		document.body.appendChild(dragObj);		
	}
}

function addDiv(id, content, left, top, width, height, visible, style, className, parent) {
	// add a delay (window.setTimeout('addDiv()', 1000)) for IE if called during page creation 
	var oDiv = document.createElement("div");

	oDiv.id = id;

	if (left!=null) oDiv.style.left = left + "px";
	if (top!=null) oDiv.style.top = top + "px";
	if (width!=null) oDiv.style.width = width + "px";
	if (height!=null) oDiv.style.height = height + "px";
	if (className!=null) oDiv.className = className;
	if (style!=null) oDiv.style.cssText += "; " + style;
	if (oDiv.style.position==null) oDiv.style.position = "absolute";	
	oDiv.innerHTML = content;
	if(parent) { parent.appendChild(oDiv); }
	else { document.body.appendChild(oDiv);	 }
	if (visible!=null) oDiv.style.visibility = visible;	
}


function createLayer2(name, inLeft, inTop, width, height, visible, content, classname, style, container) {
	document.write('<div id="' + name + '" style=" position:absolute; overflow:hidden; left:' + inLeft + 'px; top:' + inTop + 'px; width:' + width + 'px; height:' + height + 'px;' + ';  visibility:' + (visible ? 'visible;' : 'hidden;'));
	if (style!=null) document.write(style);
	document.write('"');
	if ((classname!=null) && (classname!="")) document.write(' class="' + classname + '"');
	document.writeln('>');
	document.writeln(content);
	document.writeln('</div>');
}

// get the layer object called "name"
function getLayer(name) {
	var theObj = document.getElementById(name);
	if (theObj!=null) return theObj.style;
	  else return(null);
}

// set layer background color
function setLayerBackgroundColor(name, color) {
  	var layer = getLayer(name);
    layer.backgroundColor = color;
}

// set Div Z-ORDER
function setDivZOrder(name, zvalue)
{
	var layer = getLayer(name);
	layer.zIndex = zvalue;
}

// toggle layer to invisible
function hideLayer(name) {
  	var layer = getLayer(name);
   	if (layer!=null) layer.visibility = "hidden";
	return false;
}

// toggle layer to visible
function showLayer(name) {
  	var layer = getLayer(name);
   	if (layer!=null) layer.visibility = "visible";
	return false;
}

// move layer to x,y
function moveLayer(name, x, y) {		
  	var layer = getLayer(name);	
	if (layer!=null) {	
   		layer.left = x + "px";
		layer.top  = y + "px";
	}
	return false;
}

// replace layer's content with new content
function replaceLayerContent(name, content) {
	var theObj = document.getElementById(name);
	if (theObj!=null) {	  
		theObj.innerHTML = content;	
	}
}

// check to see if the specified div is visible
function isLayerVisible(name) {
	var layer = getLayer(name);
	if (layer!=null) {
		if (layer.visibility == "visible")  return(true);
	}
	return(false);
}



// get cursor location 
function getXY(e) {
	if (isNav) {
		mouseX=e.pageX;
		mouseY=e.pageY;
	} else {
		mouseX=event.clientX + (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft);
		mouseY=event.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop);
// Added to adjust to cursor hot spot in IE 
		mouseX-=3;
		mouseY-=3;
// Added to adjust to cursor hot spot in IE

	}
	return false;
}

// clip function for zoom box edges... 
function clipLayer(name, clipleft, cliptop, clipright, clipbottom) {
	var layer = getLayer(name);
	if (layer!=null) {
		var newWidth = clipright - clipleft;
		var newHeight = clipbottom - cliptop;
		layer.height = newHeight;
		layer.width	= newWidth;
		layer.top	= cliptop  + "px";
		layer.left	= clipleft + "px";
	}
	return false;

}

// add to dynamic style sheet
function addToDynamicStyleSheet(ruleKey, ruleValue) {
	if (isIE) {
		if (m_StyleSheet==null) 
			m_StyleSheet = document.createStyleSheet();
		m_StyleSheet.addRule(ruleKey, ruleValue);
	} else {
		if (m_StyleSheet==null) {
			m_StyleSheet = document.createElement("style");
			document.body.appendChild(m_StyleSheet);
		}
		m_StyleSheet.innerHTML += ruleKey + " {" + ruleValue + "}";
	}
}

function getWinWidth () {
	var mapFrameWidth = window.innerWidth;
	if (mapFrameWidth == null) {
		if (document.documentElement && document.documentElement.clientWidth)
			mapFrameWidth = document.documentElement.clientWidth
		else	
			mapFrameWidth = document.body.clientWidth;
	}
	return mapFrameWidth;
}

 //get the Map Image height
function getWinHeight () {
	var mapFrameHeight = window.innerHeight;
	if (mapFrameHeight == null) {
		if (document.documentElement && document.documentElement.clientHeight)
			mapFrameHeight = document.documentElement.clientHeight;
		else
			mapFrameHeight = document.body.clientHeight;
	}
	return mapFrameHeight;
}

function getElementWidth (element) {
    var width = element.clientWidth;
    while (width<10 && element != null) {
        element = element.offsetParent;
        if (element != null) width = element.clientWidth;
    }
    if (width==null || width<10) width = document.documentElement.clientWidth;
    
    return width;
}

function getElementHeight (element) {
    var height = element.clientHeight;
    while (height<10 && element != null) {
        element = element.offsetParent;
        if (element != null) height = element.clientHeight;
    }
    if (height==null || height<10) height = document.documentElement.clientHeight;
    return height;
}

function getParentWidth (element) {
    if (element.offsetParent != null && element.offsetParent.id.indexOf("FWin_") == 0)
    {
        var mapId = element.offsetParent.id.substring(5);
        var windowElement = document.getElementById("FWinContents_" + mapId);
        return windowElement.clientWidth;
    }
    var parElem = element.parentElement;
    var width = 0;
    while (width==0 && parElem != null) {
        width = parElem.clientWidth;
        parElem = parElem.parentElement;
    }
    if (width==null || width==0) width = document.documentElement.clientWidth;
    
    return width;
}
function getParentHeight (element) {
    if (element.offsetParent != null && element.offsetParent.id.indexOf("FWin_") == 0)
    {
        var mapId = element.offsetParent.id.substring(5);
        var windowElement = document.getElementById("FWinContents_" + mapId);
        return windowElement.clientHeight;
    }
    var parElem = element.parentElement;
    var height = 0;
    while (height==0 && parElem != null) {
        height = parElem.clientHeight;
        parElem = parElem.parentElement;
    }
    if (height==null || height==0) width = document.documentElement.clientHeight;
    
    return height;   
}

function getMapWidth (element)
{
    var width = 0;
    var outermostElement = null;

    if (element.offsetParent != null && element.offsetParent.id.indexOf("FWin_") == 0)
    {
        var mapId = element.offsetParent.id.substring(5);
        var windowElement = document.getElementById("FWinContents_" + mapId);
        return windowElement.clientWidth;
    }
    else if (element.id.indexOf("MapControlDiv_")==0) outermostElement = element.offsetParent.offsetParent;
    
    element = outermostElement;
    while (width == 0 && element != null)
    {
        if (element.width)
            width = element.width;
        else 
            width = element.clientWidth;
        //if (isIE) width += (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft);
        element = element.offsetParent;
    }
    if (width==null || width==0) width = document.documentElement.clientWidth; // + document.documentElement.scrollLeft;
    return width;
}		

function getMapHeight (element)
{
    var height = 0;
    var outermostElement = null;

    if (element.offsetParent != null && element.offsetParent.id.indexOf("FWin_") == 0)
    {
        var mapId = element.offsetParent.id.substring(5);
        var windowElement = document.getElementById("FWinContents_" + mapId);
        return windowElement.clientHeight;
    }
    else if (element.id.indexOf("MapControlDiv_")==0) outermostElement = element.offsetParent.offsetParent;
    
    element = outermostElement;
    while (height == 0 && element != null)
    {
        if (element.height)
            height = element.height;
        else
            height = element.clientHeight;
        //if (isIE) hight += (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop);
        element = element.offsetParent;
    }
    if (height==null || height==0) height = document.documentElement.clientHeight; // + document.documentElement.scrollTop;
    return height;
}		

// get which mouse button was pressed
function isLeftButton(e) {
	var theButton= 0;
	var isLeft = false;
	// get the button pushed... if right, ignore... let browser do the popup... it will anyway
	if (isNav) {
		theButton = e.which;
	} else {
		theButton = window.event.button;
	}	
	if (theButton==leftButton) isLeft = true;
	
	return isLeft;
}

// find out if shift, ctrl, or alt keys are pressed
function checkShiftCtrlAltKeys(e) {
    if (isIE) 
        e = event;
    shiftPressed = e.shiftKey;
    ctrlPressed = e.ctrlKey;
    altPressed = e.altKey;
}


// converts color string from Netscape/Mozilla div backgrounds... 
// returned as 'rgb(r g b)'... converted to hex string
function convertNSrgb(color) {
	var h = color;
	if (h.indexOf("rgb")!=-1) {
		// netscape gets "rgb(r, g, b)", so convert to hex
		var re = /%20/gi;
		var h2 = h.replace(re, "");
		endpos = h2.indexOf(")");
		var h3 = h2.substring(4,endpos);
		var ha = h3.split(",");
		var r = parseInt(ha[0]).toString(16);
		if (r.length==1) r = "0" + r;
		var g = parseInt(ha[1]).toString(16);
		if (g.length==1) g = "0" + g;
		var b = parseInt(ha[2]).toString(16);
		if (b.length==1) b = "0" + b;
		color = r + g + b;
		//alert(color);
	}
	return color;
}

function calcElementPosition(elementId) {
	//window.status = elementId;
	var element = document.getElementById(elementId);
	eLeft = 0;
    eTop = 0;
    var eLeftBorder, eTopBorder;
	//eWidth = parseInt(element.style.width);
	//eHeight = parseInt(element.style.height);
	eWidth = element.clientWidth;
	eHeight = element.clientHeight;
    while(element != null) {
		eLeftBorder = 0;
		eTopBorder = 0;
        eLeft += element.offsetLeft;
        eTop += element.offsetTop;
        if (element!=document.documentElement) {
            eLeft -= element.scrollLeft;
            eTop -= element.scrollTop;
        }  
        if (element.style.borderWidth!="") {
			eLeftBorder = parseInt(element.style.borderWidth);
			eTopBorder = parseInt(element.style.borderWidth);
		} else if (element.style.borderLeftWidth!="") {
			eLeftBorder = parseInt(element.style.borderLeftWidth);
			eTopBorder = parseInt(element.style.borderTopWidth);
		}							
		if (isNaN(eLeftBorder)) eLeftBorder = 0;
		if (isNaN(eTopBorder)) eTopBorder = 0;
		eLeft += eLeftBorder;
		eTop += eTopBorder;
        element = element.offsetParent;
     }
	 return new RectangleObject("dummy", eLeft, eTop, eWidth, eHeight);
}

function checkForFormElement(mapdoc, formId, elemName) {
	var hasIt = false;
	if (mapdoc.forms[formId].elements[elemName] != null) hasIt = true;
	return hasIt;
}

function resizeElement(ElementId, width, height) {
	var div = document.getElementById(ElementId);
	if (div!=null) {
		if (width!=null) div.style.width = width + "px";
		if (height!=null) div.style.height = height + "px";
	}
}

function remainder(num1, num2) {
	var nfloor = Math.floor(num1 / num2);
	var ftotal = nfloor * num2;
	return(num1 - ftotal);
}


///////////////////////////////////// Common functions /////////////////////////////////////

///////////////////////////////////// Common objects ///////////////////////////////////////

	SimpleObject = function(id) {		
		this._id = this.id = id;		
	}
	SimpleObject.prototype = {
		get_id : function() {
			return this._id;
		}
	}
	SimpleObject.registerClass('SimpleObject');
	
	RectangleObject = function(id, left, top, width, height) {
		RectangleObject.initializeBase(this,[id]);
		//inheritsFrom(new SimpleObject(id), this);
		this.left = left;
		this.top = top;
		this.width = width;
		this.height = height;
	}
	RectangleObject.registerClass('RectangleObject',SimpleObject);
	
	PageElementObject = function(id, left, top, width, height) {
		//inheritsFrom(new RectangleObject(id, left, top, width, height), this);
		PageElementObject.initializeBase(this,[id, left, top, width, height]);
		this.left = left;
		this.top = top;
		this.width = width;
		this.height = height;
		
		this.divId = "";
		this.divObject = null;
		this.document = document;
		this.cursor = "default";
		
		//this.createDivs = null;
	}
	PageElementObject.prototype = {
		show : function() { this.divObject.display=''; },
		hide : function() { this.divObject.display='none'; },
		createDivs : null
	}
	PageElementObject.registerClass('PageElementObject',RectangleObject);
	
	function ControlObject(id, controlType, left, top, width, height) {
		ControlObject.initializeBase(this,[id, left, top, width, height]);
		//inheritsFrom(new PageElementObject(id, left, top, width, height), this);
		this.controlType = controlType;
		this.controlName = id;
		this.mode = "";
		
		this.pageLeft = 0;
		this.pageTop = 0;
		this.xMin = 0;
		this.yMin = 0;
		this.xMax = 0;
		this.yMax = 0;
		this.coords = "";
		
		this.clientAction = "";
		this.actionType = "";
		
		this.pageID = "";
		this.enableClientPostBack = false;
		this.buddyControls = "";
		this.toolsForcingPostback = "";
		
		this.resetDisplay = null;		
	}
	ControlObject.prototype = {
		resize : function(width, height) {
			this.width = width;
			this.height = height;
		},
		setObjects : null,
		setTool : null
	}
	ControlObject.registerClass('ControlObject',PageElementObject);
	// 



var winWidth = getWinWidth();
var winHeight = getWinHeight();

//////////////////////// IE functionality for Mozilla/Netscape ///////////////////////////////
	// make Mozilla browsers emulate IE's node/element functionality
if (isNav) {
	Element.prototype.contains = function(element){
		var range=document.createRange();
		range.selectNode(this);
		return range.compareNode(element)==3;
	}
	
	Element.prototype.applyElement = function(element, where){
		if(!element.splitText){
			element.removeNode();
			if(where && where.toLowerCase()=="inside"){
				for(var i=0;i<this.childNodes.length;i++){
					element.appendChild(this.childNodes[i])
				}
				this.appendChild(element)
			}else{
				var parent_Node=this.parentNode;
				parent_Node.insertBefore(element,this);
				element.appendChild(this);
			}
			return element;
		}
	}

	Element.prototype.insertAdjacent=function(where, element){
		var parent_Node=this.parentNode;
		switch(where.toLowerCase()) {
			case "beforebegin":
				parent_Node.insertBefore(element,this);
				break;
			case "afterend":
				parent_Node.insertBefore(element,this.nextSibling);
				break;
			case "afterbegin":
				this.insertBefore(element,this.childNodes[0]);
				break;
			case "beforeend":
				this.appendChild(element);
				break;
		}
	}
		
	Element.prototype.insertAdjacentText = function(where, text){
		var text_Node=document.createTextNode(text||"")
		this.insertAdjacent(where, text_Node);
	}
	
	Element.prototype.insertAdjacentHTML = function(where, html){
		var range=document.createRange();
		range.selectNode(this);
		var fragment=range.createContextualFragment(html);
		this.insertAdjacent(where, fragment);
	}

	Element.prototype.insertAdjacentElement = function(where,element){
		this.insertAdjacent(where,element);
		return a2;
	}

//	Node.prototype.removeNode = function (node){
//		var parent_Node=this.parentNode;
//		if(parent_Node && !node){
//			var fragment=document.createDocumentFragment();
//			for(var i=0;i<this.childNodes.length;i++){
//				fragment.appendChild(this.childNodes[i])
//			}
//			parent_Node.insertBefore(fragment,this)
//		}
//		return parent_Node ? parent_Node.removeChild(this):this;
//	}

    Node.prototype.removeNode = function( removeChildren ) {
	    var self = this;
	    if ( Boolean( removeChildren ) )
	    {
		    return this.parentNode.removeChild( self );
	    }
	    else
	    {
		    var range = document.createRange();
		    range.selectNodeContents( self );
		    return this.parentNode.replaceChild( range.extractContents(), self );
	    }
    }

	Node.prototype.replaceNode = function (node){
		return this.parentNode.replaceChild(node,this)
	}

	Node.prototype.swapNode=function(node){
		var parent_Node=node.parentNode;
		var next_Sibling=node.nextSibling;
		this.parentNode.replaceChild(node,this);
		parent_Node.insertBefore(this, next_Sibling)
		return this;
	}

    // outerHTML implementation
    var _emptyTags = {
       "IMG":   true,
       "BR":    true,
       "INPUT": true,
       "META":  true,
       "LINK":  true,
       "PARAM": true,
       "HR":    true
    };

    HTMLElement.prototype.__defineGetter__("outerHTML", function () {
       var attrs = this.attributes;
       var str = "<" + this.tagName;
       for (var i = 0; i < attrs.length; i++)
          str += " " + attrs[i].name + "=\"" + attrs[i].value + "\"";

       if (_emptyTags[this.tagName])
          return str + ">";

       return str + ">" + this.innerHTML + "</" + this.tagName + ">";
    });

    HTMLElement.prototype.__defineSetter__("outerHTML", function (sHTML) {
       var r = this.ownerDocument.createRange();
       r.setStartBefore(this);
       var df = r.createContextualFragment(sHTML);
       this.parentNode.replaceChild(df, this);
    });

}


function addEvent(obj, eventName, funct) {
    if (obj.addEventListener) {
        obj.addEventListener(eventName, funct, false); 
        return true;
    } else if (obj.attachEvent) {
        var att = obj.attachEvent("on" + eventName, funct);
        if (!att) alert("Unable to add " + eventName + " event to " + obj.id);
        return att;
    } else {
        alert("Unable to add " + eventName + " event to " + obj.id);
        return false;
    }        
}

function removeEvent(obj, eventName, funct) {
    if (obj.removeEventListener) {
        obj.removeEventListener(eventName, funct, false);
        return true;
    } else if (obj.attachEvent) {
        return obj.detachEvent("on" + eventName, funct);
    } else {
        return false;
    }
}


/*
////////////////////////////// Pre 9.2 function support ////////////////////////////////
// Functions with 9.1 names, calling 9.2 functionality... 
// For support of projects created prior to 9.2
// These functions are called by 9.1 MapViewer Template Identify
/////////////////////////////////////////////////////////////////////////////////////////

function getMapDiv(e) {
	map = getSelectedMapObject(e);
}

function ShowLoading() {
	if (map!=null) {
		if (map.loadingObject!=null) map.loadingObject.show();
	}
	if (page!=null) {
		if (page.loadingObject!=null) page.loadingObject.show();	
	} 
}

function HideLoading() {
	if (map!=null) {
		if (map.loadingObject!=null) map.loadingObject.hide();
	}
	if (page!=null) {
		if (page.loadingObject!=null) page.loadingObject.hide();	
	}
}

function adjustMapCoords() {
	zleft = mouseX - map.pageLeft;
	ztop = mouseY - map.pageTop;
	map.xMin=zleft;
	map.yMin=ztop;
	return null;
}
*/

////////////////////////////// Common Timing functions ////////////////////////////////
// 
/////////////////////////////////////////////////////////////////////////////////////////

var lastResponseReceivedTime = new Date();
var maximumLapseTime = 10; // Change this value to session timeout in minutes


// function executed when page is loaded... other functions can check webPageIsLoaded if necessary before executing
function webPageLoaded() {
    webPageIsLoaded = true;
}

// function that does nothing... used in required hyperlinks such as in treeview so page won't refresh
    // called in link as "javascript: doNothing();"
function doNothing() {
    // nothing happening here
}

// function that gets the elapsed time between requests... so client knows when the server code will not respone anymore
function getSessionLapse() {
    var now = new Date();
    var last = lastResponseReceivedTime;
    var diff = Math.floor((now.getTime() - last.getTime()) / (1000 * 60));
    return diff;
}

// function that resets the global laspe start time
function setSessionLapse() {
    lastResponseReceivedTime = new Date();
}

// function that displays an alert indicating session has lapsed
function showLapseAlert() {
    alert("Session has timed out from extended inactivity. A new session must be started to use this application by closing this browser and reopening.");
}

function switchImageSourceAndAlphaBlend(imgElement, newSource, forcePng)
{
    if (forcePng==null) forcePng = false;
    if (imgElement!=null)
    {
        if (ESRI.ADF.System.__isIE6)
        {
            var imageUrl=newSource;
            var imageType=imageUrl.substr(imageUrl.length-3,3);
            if (imageType=="png" || forcePng){
			    if (imgElement.runtimeStyle.filter.indexOf("DXImageTransform.Microsoft.AlphaImageLoader")> -1) {
				    imgElement.filters['DXImageTransform.Microsoft.AlphaImageLoader'].src = newSource;
                }
			    else {
			        imgElement.runtimeStyle.filter += "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + newSource + "',sizingMethod='image');";
					imgElement.src = esriBlankImagePath;
				}
			}
			else {
			    imgElement.src=newSource;
			}
        }
        else
        {
            imgElement.src=newSource;
        }
    }
}
/*
function iframeHideWorkaroundForVML()
{
        if (isIE && ieVersion < 7)
        {
            var iframes=document.getElementsByTagName("iframe");
            if (iframes==null)return;
            for (var i=0;i<iframes.length;i++)
            {
                var iframe=iframes[i];
                if (iframe==null)continue;
                if (iframe.style.hiddenForIE6==null)
                {
                    if (iframe.style.visibility!=null) iframe.style.hiddenForIE6=new String(iframe.style.visibility.toString());
                    iframe.style.visibility='hidden';
                }
           } 
        }
}

function iframeShowWorkaroundForVML()
{
        if (isIE && ieVersion < 7)
        {
            var iframes=document.getElementsByTagName("iframe");
            if (iframes==null)return;
            for (var i=0;i<iframes.length;i++)
            {
                var iframe=iframes[i];
                if (iframe==null)continue;
                if (iframe.style.hiddenForIE6!=null)
                {
                    iframe.style.visibility=iframe.style.hiddenForIE6;
                    iframe.style.hiddenForIE6=null; 
                }
           } 
        }
}

var commonLoaded = true;
*/
function setElementDisplayStyle(id, style)
{
    var elem = document.getElementById(id);
    if (elem != null)
        elem.style.display = style;
}

function expandCollapseElement(expandCollapseImageId, elementId, collapsedImage, expandedImage)
{
    var elem = document.getElementById(elementId);
    var src;
    if (elem != null)
    {
        if (elem.style.display == "none") //collapsed; so expand
        {
            elem.style.display = "block";
            src = expandedImage; 
        }
        else//expanded; so collapse
        {
            elem.style.display = "none";
            src = collapsedImage; 
        }
       if (expandCollapseImageId != null)
        { 
            var image = document.getElementById(expandCollapseImageId);
            if (image != null)
                image.src = src;
        } 
    }
}

function enableDisableElements(enableIds, disableIds)
{
    var element = null;
    if (enableIds != null)
    { 
        var enableArray = enableIds.split(',');
        if (enableArray != null && enableArray.length >0)
        {
            for(var i=0;i<enableArray.length;++i)
            {
                element = document.getElementById(enableArray[i]);
                if (element != null)
               { 
                    element.disabled = false;
                    element.style.color = "";
               } 
            } 
        } 
    } 
    if (disableIds != null)
    { 
        var disableArray = disableIds.split(',');
        if (disableArray != null && disableArray.length >0)
        {
            for(var i=0;i<disableArray.length;++i)
            {
                element = document.getElementById(disableArray[i]);
                if (element != null)
               { 
                    element.disabled = true;  
                    element.style.color = "Gray"; //spans(labels) cannot be disabled in Mozilla.  They have to be grayed out.
               } 
            } 
        } 
    }        
}

function addScriptTag(id, type, language, src, defer, charset, content)
{
    var scriptObj = document.createElement("script");
    // Add script object attributes
    if (id != null) scriptObj.setAttribute("id", id);
    if (type != null) scriptObj.setAttribute("type", type);
    if (charset != null) scriptObj.setAttribute("charset", charset);
    if (src != null) scriptObj.setAttribute("src", src);
    if (language != null) scriptObj.setAttribute("language", language);
    if (defer != null) scriptObj.setAttribute("defer", defer);
   if (content != null) scriptObj.text = content; 
    var headLoc = document.getElementsByTagName("head").item(0);
    headLoc.appendChild(scriptObj);
}
//END ESRI.ArcGIS.ADF.Web.UI.WebControls.Runtime.JavaScript.display_common.js
//START ESRI.ArcGIS.ADF.Web.UI.WebControls.Runtime.JavaScript.ESRI.ADF.System.release.js
//----------------------------------------------------------
// Copyright (C) ESRI. All rights reserved.
//----------------------------------------------------------
Type.registerNamespace('ESRI.ADF.System');ESRI.ADF.System.addMouseWheelHandler = function(element, handler, handlerOwner) {
if (typeof(handler) !== 'function') { throw Error.invalidOperation(Sys.Res.cantAddNonFunctionhandler);}
if(handlerOwner) {
handler = Function.createDelegate(handlerOwner, handler);}
if(Sys.Browser.agent===Sys.Browser.InternetExplorer || Sys.Browser.agent===Sys.Browser.Safari || Sys.Browser.agent===Sys.Browser.Opera) {
var fnc = Function.createDelegate(handlerOwner, function (sender) { return handler.call(element, ESRI.ADF.System.addMouseWheelHandler._convertWheelEventIE(sender));});$addHandler(element, "mousewheel",fnc);}
else if(element.addEventListener) {
var fnc = Function.createDelegate(handlerOwner, function (sender) { return handler.call(element, ESRI.ADF.System.addMouseWheelHandler._convertWheelEventMozilla(sender));});$addHandler(element, "DOMMouseScroll", fnc);} 
}
ESRI.ADF.System.addMouseWheelHandler._convertWheelEventIE = function(sender) {
sender.type = 'mousewheel';sender.wheelDelta = sender.rawEvent.wheelDelta;sender.preventDefault();sender.stopPropagation();return sender;};ESRI.ADF.System.addMouseWheelHandler._convertWheelEventMozilla = function(sender) {
sender.type = 'mousewheel';sender.wheelDelta = -sender.rawEvent.detail*40;sender.screenX = sender.rawEvent.screenX;sender.screenY = sender.rawEvent.screenY;sender.clientX = sender.rawEvent.pageX;sender.clientY = sender.rawEvent.pageY;sender.offsetX = sender.rawEvent.layerX;sender.offsetY = sender.rawEvent.layerY;sender.preventDefault();sender.stopPropagation();return sender;};ESRI.ADF.System._makeMouseEventRelativeToElement = function(evt,element,location) {
var e = evt;if(e.target && element && element!==e.target)
{ 
e = {};for(var idx in evt) e[idx] = evt[idx];if(!location) { location = Sys.UI.DomElement.getLocation(element);}
if(Sys.Browser.agent===Sys.Browser.InternetExplorer) {
if(e.target.parentNode===document.body) { e.target = document.body;}
e.offsetX = evt.screenX-window.screenLeft-location.x+document.documentElement.scrollLeft - 2;e.offsetY = evt.screenY-window.screenTop-location.y+document.documentElement.scrollTop - 2;}
else {
var eventLocation = Sys.UI.DomElement.getLocation(e.target);var diffX = eventLocation.x-location.x;var diffY = eventLocation.y-location.y;e.offsetX += diffX;e.offsetY += diffY;}
e.target = element;}
return e;};ESRI.ADF.System._templateBinderAttrRegEx = new RegExp("{@.*?}","g")
ESRI.ADF.System._templateBinderEvalRegEx = new RegExp("{eval(.*?)}","g");ESRI.ADF.System.templateBinder = function(dataItem,template) {
if(!template) { return '';}
var str = template;for(var idx in dataItem){
var re = new RegExp("{@" + idx + "}","g");str = str.replace(re,dataItem[idx]);}
var evalRe = new RegExp("\\{eval\\((.*?)\\)\\}", "g");var myArray = str.match(evalRe);if(myArray != null){
for(var idx=0;idx<myArray.length;idx++){
var result = eval(myArray[idx].replace(evalRe,"$1"));str = str.replace(myArray[idx],result);}
}
return str;};ESRI.ADF.System.arrayTemplateBinder = function(dataItems,itemTemplate,headerTemplate,footerTemplate,separatorTemplate,alternatingItemTemplate) {
var str = '';if(headerTemplate) str += headerTemplate;for(var idx=0;idx<dataItems.length;idx++) {
var dataItem = dataItems[idx];if(alternatingItemTemplate && idx%2==1)
str += ESRI.ADF.System.templateBinder(dataItem,alternatingItemTemplate);else
str += ESRI.ADF.System.templateBinder(dataItem,itemTemplate);if(separatorTemplate && idx<dataItems.length-1) str += separatorTemplate;}
if(footerTemplate) str += footerTemplate;return str;};ESRI.ADF.System.setOpacity = function(element,value) {
if (!element) { return;}
var filters = null;if(element.runtimeStyle) { filters = element.runtimeStyle.filter;}
if (filters!=null) {
var createFilter = true;if (filters.length !== 0) {
if(filters.indexOf('progid:DXImageTransform.Microsoft.Alpha')>-1) {
var filter = element.filters['DXImageTransform.Microsoft.Alpha'];if(value===1) {
var pngFilter = (ESRI.ADF.System.__isIE6?element.filters['progid:DXImageTransform.Microsoft.AlphaImageLoader']:null);element.runtimeStyle.filter = '';if(pngFilter) {ESRI.ADF.System.setIEPngTransparency(element,pngFilter.src,pngFilter.sizingMethod==='image',element.format);}
}
else {
filter.opacity = value * 100;filter.enabled = true;}
createFilter = false;}
}
if (createFilter && value!==1) {
element.runtimeStyle.filter += 'progid:DXImageTransform.Microsoft.Alpha(opacity=' + (value * 100) + ')';}
}
else {
element.style.opacity = value;}
};ESRI.ADF.System.setIEPngTransparency = function(img,src,noscale,format) {
if(ESRI.ADF.System.__isIE6 && img && img.tagName==='IMG') {
var srcLC = (format?'.'+format:src).toLowerCase();if(srcLC.endsWith('.gif') || srcLC.endsWith('.jpg') || format && !format.toLowerCase().startsWith('png')) { 
if (img.runtimeStyle.filter.indexOf("DXImageTransform.Microsoft.AlphaImageLoader")> -1) {
var opacityFilter = img.filters['DXImageTransform.Microsoft.Alpha'];img.runtimeStyle.filter = '';if(opacityFilter) ESRI.ADF.System.setOpacity(img,opacityFilter.opacity/100);}
img.src = src;}
else {
if (img.runtimeStyle.filter.indexOf("DXImageTransform.Microsoft.AlphaImageLoader")> -1) {
img.filters['DXImageTransform.Microsoft.AlphaImageLoader'].src = src;img.filters['DXImageTransform.Microsoft.AlphaImageLoader'].enabled = true;img.filters['DXImageTransform.Microsoft.AlphaImageLoader'].sizingMethod = (noscale?'image':'scale');img.format = format;}
else {
img.runtimeStyle.filter += "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "',sizingMethod='"+(noscale?'image':'scale')+"');";img.src = esriBlankImagePath;}
}
}
};ESRI.ADF.System.__isIE6 = (Sys.Browser.agent === Sys.Browser.InternetExplorer && Sys.Browser.version<7)
ESRI.ADF.System.ContentAlignment = function() {
throw Error.invalidOperation();};ESRI.ADF.System.ContentAlignment.prototype = {
TopLeft : 1,
TopCenter : 2,
TopRight : 4,
MiddleLeft : 16,
MiddleCenter : 32,
MiddleRight : 64,
BottomLeft : 256,
BottomCenter : 512,
BottomRight : 1024
};ESRI.ADF.System.ContentAlignment.registerEnum("ESRI.ADF.System.ContentAlignment", false);__esriDoPostBack = ESRI.ADF.System.__DoPostBack = function(uniqueId, clientId, argument, clientCallback, context) {
var status = Sys.WebForms.PageRequestManager.getInstance().get_isInAsyncPostBack();if(status) {
if(!ESRI.ADF.System._postBackQueue) { ESRI.ADF.System._postBackQueue = [];}
var fnc = Function.createDelegate(this, function() { ESRI.ADF.System.__DoPostBack(uniqueId, clientId, argument, clientCallback, context) });Array.add(ESRI.ADF.System._postBackQueue,fnc);}
else {
if(clientCallback) {
var _fncLoading = function(sender, args) {
Sys.WebForms.PageRequestManager.getInstance().remove_pageLoading(_fncLoading);clientCallback(sender, args, clientId, context);}
Sys.WebForms.PageRequestManager.getInstance().add_pageLoading(_fncLoading);}
__doPostBack(uniqueId, argument);}
};ESRI.ADF.System._checkQueue = function() {
if(ESRI.ADF.System._postBackQueue && ESRI.ADF.System._postBackQueue.length>0) {
var fnc = ESRI.ADF.System._postBackQueue[0];Array.removeAt(ESRI.ADF.System._postBackQueue,0);fnc();}
};if(Sys.WebForms) {
Sys.Application.add_init(function() {
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(ESRI.ADF.System._checkQueue);});};ESRI.ADF.System.ProcessMSAjaxCallbackResult = function(sender, args, controlId, context) {
var dataItems = args.get_dataItems();if(dataItems[controlId])
ESRI.ADF.System.processCallbackResult(dataItems[controlId],context);};ESRI.ADF.System._doCallback = function(callbackFunctionString, uniqueID, id, argument, context) {
if(ESRI.ADF.System.checkSessionExpired()) return;if(callbackFunctionString && !callbackFunctionString.startsWith('__esriDoPostBack'))
{
if(callbackFunctionString) {
window.setTimeout(Function.createDelegate(context,function() { eval(callbackFunctionString) }),0);}
}
else {
ESRI.ADF.System.__DoPostBack(uniqueID, id, argument, ESRI.ADF.System.ProcessMSAjaxCallbackResult, context);}
};ESRI.ADF.System.__epsilon = 1E-12;processCallbackResult = ESRI.ADF.System.processCallbackResult = function(response, context) {
if(!response) { return;}
var results=[];if(response.startsWith('///:::')) { 
var pairs = response.split("^^^");for (var k=0;k<pairs.length;k++) {
var item = pairs[k];if (item===null || item.length===0) { continue;} 
var actions = item.split(":::");if(actions.length<3) { continue;}
var type = actions[0].toLowerCase();var cntlID = actions[1];var actn = actions[2].toLowerCase();var pars = [];for(var j=3;j<actions.length;j++) {
Array.add(pars,actions[j]);}
Array.add(results,{"id":cntlID,"type":type,"action":actn,"params":pars});}
}
else { 
try { results = eval(response);}
catch(ex) {
Sys.Debug.trace('Failed to process page response: "' + response + '"');return;} 
}
ESRI.ADF.System.resetSessionLapse();var validResponse = false;for (var idx=0;idx<results.length;idx++)
{ 
var result = results[idx];var controlID = result.id;var controlType = result.type;var obj = null;if(controlID) { obj = $find(controlID);}
var action = result.action.toLowerCase();var params = result.params;if(action==='javascript') {
var method = function() {
try { eval(params[0]);}
catch(ex) { Sys.Debug.trace('CallbackResult[javascript]: Could not evaluate JavaScript: ' + params[0] +'\\n' + ex.name+' (' + ex.number + '):\\n' + ex.message);}
};if(obj || context) {
Function.createDelegate(obj?obj:context,method)();}
else { method();}
validResponse = true;continue;}
else if (action==="content") {
var o = $get(controlID);if (o) { o.outerHTML=params[0];}
else { Sys.Debug.trace('CallbackResult[content]: Element "' + controlID + '" not found');} 
validResponse = true;continue;}
else if (action==="innercontent") {
var o2 = $get(controlID);if (o2) { o2.innerHTML=params[0];validResponse = true;}
else { Sys.Debug.trace('CallbackResult[innercontent]: Element "' + controlID + '" not found');}
continue;}
else if (action==="image")
{
var o3 = $get(controlID);if (o3) { o3.src = params[0];}
else { Sys.Debug.trace('CallbackResult[image]: Image element "' + controlID + '" not found');}
validResponse = true;continue;}
else if (action==="set")
{
if(obj) {
var properties = params[0];if(String.isInstanceOfType(params[0])) {
properties = eval('('+params[0]+')');}
for(var name in properties) {
var val = properties[name];var setter = obj["set_" + name];if (setter && typeof(setter) === 'function') { setter.apply(obj, [val]);}
else { obj.name = val;}
}
}
else { Sys.Debug.trace('CallbackResult[set]: Component "' + controlID + '" not found');}
validResponse = true;continue;}
else if (action==='invoke') {
var method = null;var methodname = params[0];if(obj) { 
method = obj[methodname];}
else if(!controlID) { 
try { method = eval('('+methodname+')');}
catch(ex) { }
}
else {
Sys.Debug.trace('CallbackResult[invoke]: Component "' + controlID + '" not found');continue;}
if(method && typeof(method) == 'function') {
var args = params[1];if(args) {
if(Array.isInstanceOfType(args)) { method.apply(obj,args);}
else { method.apply(obj,[args]);}
}
else { method.apply(obj);}
}
else { Sys.Debug.trace('CallbackResult[invoke]: Invalid method "' + (controlID?controlID+'.':'')+methodname + '"');}
validResponse = true;continue;}
else if (action=='include') {
var id = params[0];var elm = (id?$get(id):null);if(elm) { elm.parentNode.removeChild(elm);}
elm=null;var src = params[1];var tagname = params[2];var type = params[3];var language = params[4];elm = document.createElement(tagname);if(id) { elm.id = id;}
if(tagname==='link') { elm.href = src;}
else { elm.src = src;}
if(type) { 
elm.type = type;if(type==='text/css') { elm.rel = 'stylesheet';}
}
if(language) { elm.language = language;}
document.getElementsByTagName('head').item(0).appendChild(elm);validResponse = true;continue;}
else if(obj && obj.processCallbackResult) {
validResponse = obj.processCallbackResult(result.action,params);if (obj._cancelled) {
obj._cancelled = false;return;}
continue;}
if(!validResponse) {
Sys.Debug.trace('CallbackResult action "' + action+ '" couldn\'t be processed.');}
}
if (validResponse)
{
lastResponseReceivedTime=new Date();}
};Type.registerNamespace('ESRI.ADF.UI.__DomEvent');ESRI.ADF.UI.__DomEvent = function(e) {
var target = e.target ? e.target : e.srcElement;if ((target !== window) && (target !== document) &&
!(window.HTMLElement && (target instanceof HTMLElement)) &&
(typeof(target.nodeName) !== 'string')) {
e.target = document.body;}
if(target.parentNode==null) return;ESRI.ADF.UI.__DomEvent.initializeBase(this, [e]);};ESRI.ADF.UI.__DomEvent.registerClass('ESRI.ADF.UI.__DomEvent',Sys.UI.DomEvent);ESRI.ADF.UI.__DomEvent.__addHandler = function (element, eventName, handler) {
if (!element._events) {
element._events = {};}
var eventCache = element._events[eventName];if (!eventCache) {
element._events[eventName] = eventCache = [];}
var browserHandler;if (element.addEventListener) {
browserHandler = function(e) {
return handler.call(element, new ESRI.ADF.UI.__DomEvent(e));}
element.addEventListener(eventName, browserHandler, false);}
else if (element.attachEvent) {
browserHandler = function() {
return handler.call(element, new ESRI.ADF.UI.__DomEvent(window.event));}
element.attachEvent('on' + eventName, browserHandler);}
eventCache[eventCache.length] = {handler: handler, browserHandler: browserHandler};};ESRI.ADF.System.__getAbsoluteMousePosition = function(e) {
var mouseX = 0;var mouseY = 0;if(e && typeof(e.pageX)!=='undefined' && typeof(e.pageY)!=='undefined') {
mouseX=e.pageX;mouseY=e.pageY;}
else {
e = window.event;mouseX=event.clientX + (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft);mouseY=event.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop);}
return {"mouseX":mouseX,"mouseY":mouseY};};ESRI.ADF.System.__lastResponseRecievedTime = new Date();ESRI.ADF.System.__sessionExpired = false;ESRI.ADF.System.checkSessionExpired = function() {
var now = new Date();var last = ESRI.ADF.System.__lastResponseRecievedTime;var diff = Math.floor((now.getTime() - last.getTime()) / (1000 * 60));if(!ESRI.ADF.System.maximumLapseTime) { return false;} 
var hasExpired = (diff>=ESRI.ADF.System.maximumLapseTime);if(hasExpired && !ESRI.ADF.System.__sessionExpired) { 
ESRI.ADF.System.__sessionExpired = true;ESRI.ADF.System.showLapseAlert();}
return hasExpired;};ESRI.ADF.System.resetSessionLapse = function () {
ESRI.ADF.System.__lastResponseRecievedTime = new Date();};ESRI.ADF.System.showLapseAlert = function() {
alert("Session has timed out from extended inactivity. A new session must be started to use this application by closing this browser and reopening.");};ESRI.ADF.System.escapeForCallback = function(toEscape) {
if (toEscape) 
{
toEscape = toEscape.replace(/&/g, "__amp__");}
return toEscape;};if (typeof(Sys) !== 'undefined') { Sys.Application.notifyScriptLoaded();}

//END ESRI.ArcGIS.ADF.Web.UI.WebControls.Runtime.JavaScript.ESRI.ADF.System.release.js
//START ESRI.ArcGIS.ADF.Web.UI.WebControls.Runtime.JavaScript.display_dotnetadf.js
/*
COPYRIGHT 1995-2003 ESRI

TRADE SECRETS: ESRI PROPRIETARY AND CONFIDENTIAL
Unpublished material - all rights reserved under the 
Copyright Laws of the United States.

For additional information, contact:
Environmental Systems Research Institute, Inc.
Attn: Contracts Dept
380 New York Street
Redlands, California, USA 92373


email: contracts@esri.com
*/


// set path for loading banner image
loadBannerPath = "images";
var displayLoading = false;
var sendDelay = 100;
var currentEventArg = "";

activeControl = "Map1";
var esriCurrentResponseCount = 0;
var esriLastResponseCount = -1;
var postBackInterval = null;

var clientPostbackEventArgs = new Array();
// add additional control non-tool event args, if necessary
clientPostbackEventArgs[0] = "resize";
clientPostbackEventArgs[1] = "scrollwheelzoom";
clientPostbackEventArgs[2] = "dragimage";
clientPostbackEventArgs[3] = "drawtile";
clientPostbackEventArgs[4] = "getextent";
clientPostbackEventArgs[5] = "newextent";
clientPostbackEventArgs[6] = "dragrectangle";
clientPostbackEventArgs[7] = "changelevel";
clientPostbackEventArgs[8] = "point";
clientPostbackEventArgs[9] = "line";
clientPostbackEventArgs[10] = "polyline";
clientPostbackEventArgs[11] = "polygon";
clientPostbackEventArgs[12] = "circle";
clientPostbackEventArgs[13] = "oval";


function postBack(control, eventArg, responseFunction) {
	//eventArg = eventArg.toLowerCase();
	currentEventArg = eventArg;	
	//var map2 = Maps[control];
	//var ov2 = Overviews[control];
	//var page2 = Pages[control];
	var toolbar2 = Toolbars[control];
//	var toc2 = Tocs[control];
	var forcePostBack  = false;
	activeControl = control;
	var mode = "";
	var f;
//	if (map2!=null) {
//		// map request
//		f = map2.document.forms[docFormID];
//		f.minx.value = map2.xMin;
//		f.miny.value = map2.yMin;
//		f.maxx.value = map2.xMax;
//		f.maxy.value = map2.yMax;
//		f.coords.value = map2.coords;
//		var postbackEvents = map2.forcePostBackEvent.split(",");
//		for (var h=0;h<clientPostbackEventArgs.length;h++)
//		{	// Check if eventArg is a PostBack event arg.
//			if (eventArg.toLowerCase()==clientPostbackEventArgs[h])
//			{	//check postback event
//				for (var i=0;i<postbackEvents.length;i++)
//				{	// Check if Postback is for Map Mode.
//					if (map2.mode==postbackEvents[i])
//						forcePostBack = true;
//				}
//			}
//		}
//		f.elements[control + "_mode"].value = map2.mode;
//		mode = map2.mode;
//		map2.mode = map2.tempMode;
//		map2.actionType = map2.tempAction;
//		map2.cursor = map2.tempCursor;
//		if (map2.callBackFunctionString!=null) callBackFunctionString = map2.callBackFunctionString;
//	}
//	 else if (page2!=null) {
//		// page request
//		f = page2.document.forms[docFormID];
//		f.minx.value = page2.xMin;
//		f.miny.value = page2.yMin;
//		f.maxx.value = page2.xMax;
//		f.maxy.value = page2.yMax;
//		f.coords.value = page2.coords;
//		var supportpostbackEvents = page2.toolsSupportingClientPostBack.split(",");
//		for (var j=0;j<clientPostbackEventArgs.length;j++)
//		{	// Check if eventArg is a PostBack event arg.
//			if (eventArg.toLowerCase()==clientPostbackEventArgs[j])
//			{	//check postback event
//				for (var k=0;k<supportpostbackEvents.length;k++)
//				{	// Check if Postback is for Page Mode.
//					if (page2.mode==supportpostbackEvents[k])
//						forcePostBack = true;
//				}
//			}
//		}
//		f.elements[control + "_mode"].value = page2.mode;
//		mode = page2.mode;
//		page2.mode = page2.tempMode;
//		page2.actionType = page2.tempAction;
//		page2.cursor = page2.tempCursor;
//		if (page2.callBackFunctionString!=null) callBackFunctionString = page2.callBackFunctionString;
//	} else if (ov2!=null) {
//		// overview request
//		f = ov2.document.forms[docFormID];
//		f.centerx.value = ov2.centerX;
//		f.centery.value = ov2.centerY;
//        if (eventArg==ov2.forcePostBackEvent)
//            forcePostBack = true;
//		if (ov2.callBackFunctionString!=null) callBackFunctionString = ov2.callBackFunctionString;
//	}  else
	 if (toolbar2!=null) {
		f = toolbar2.document.forms[docFormID];
		//find out if item supports client postback
		// ToDo: set up for forced postback
//		if (toolbar2.enableClientPostBack &&
//			(isForcePostBackTool(eventArg, toolbar2.buttonsSupportingClientPostBack)
//		  || eventArg == "resize" || eventArg == "drawtile") )
//			forcePostBack = true;
		if ((toolbar2.items[currentEventArg]!=null) && (toolbar2.items[currentEventArg].selectAutoPostBack))
			forcePostBack = true;
		if (toolbar2.callBackFunctionString!=null) callBackFunctionString = toolbar2.callBackFunctionString;
	} 	else if (toc2 !=null) {
		f = toc2.document.forms[docFormID];
		//enableClientPostBack = toc2.enableClientPostBack;
		if (toc2.callBackFunctionString!=null) callBackFunctionString = toc2.callBackFunctionString;
	} else {
		alert(control + " is not available or does not exist.");
		return false;
	}
	if (f.elements["PostBackMode"]!=null) f.PostBackMode.value = f.elements[control+"_mode"].value;
	//alert("forcePostBack=" + forcePostBack);
	if (forcePostBack) {
		__doPostBack(control, eventArg);
	} else {
		// send to ClientPostBack
		var querystring = createClientPostBackQueryString(control, eventArg);
		clientPostBack(querystring);
	}
	
	map2=null;
	page2=null;
	ov2=null;
	toolbar2=null;
	toc2=null;
}

function clientPostBack(querystring) {
	
	var argument = querystring;
	var context = activeControl + "," + currentEventArg;
	if (querystring!=null && querystring.length>0) {
		eval(callBackFunctionString);
		// Debug stuff to be removed, or at least commented out
		if (checkForFormElement(document, 0, "MapDebugBox")) document.forms[0].MapDebugBox.value += "PostBack Request: " + querystring + "\n";
	}
}

function delayedClientPostBack(argument, context, callbackString) {
    if (commonCallbackFree) {
        eval(callBackString);
// Debug stuff to be removed, or at least commented out
if (checkForFormElement(document, 0, "MapDebugBox")) document.forms[0].MapDebugBox.value += "PostBack Request: " + querystring + "\n";
        window.clearInterval(postBackInterval);
        commonCallbackFree = false;
    }

}

function postBackError(argument, context) {
	alert("An unhandled exception has occurred:\n" + argument);
}

function createClientPostBackQueryString(control, eventArg) {
	var s = "ControlID=" + control;
	s += "&EventArg=" + eventArg;
	var map2 = map;
	var ov2 = ov;
	var page2 = page;
	var map2 = Maps[control];
	var ov2 = Overviews[control];
	var page2 = Pages[control];
	var toolbar2 = Toolbars[control];
	var toc2 = Tocs[control];
	var f;
	if (map2!=null) {
	  f = map2.document.forms[docFormID];
		s += "&ControlType=Map&PageID=" + map2.pageID;
	} else if (ov2!=null) {
	  f = ov2.document.forms[docFormID];
		s += "&ControlType=OverviewMap&PageID=" + ov2.pageID;
	} else if (page2!=null) {
	  f = page2.document.forms[docFormID];
		s += "&ControlType=PageLayout&PageID=" + page2.pageID;
		s += "&dataframeIndex=" + page2.dataframeIndex;
	} else if (toolbar2!=null) {
	  f = toolbar2.document.forms[docFormID];
		s += "&ControlType=Toolbar&PageID=" + toolbar2.pageID;
	} else if (toc2!=null) {
	  f = toc2.document.forms[docFormID];
		s += "&ControlType=Toc&PageID=" + toc2.pageID;
	}
	
	if (f != null)
	{
	  var fieldList = f.elements["ESRIWebADFHiddenFields"].value;
	  var fields = fieldList.split(',');
	  var value;
	  for (var i= 0; i < fields.length; ++i)
	  {
	    if (f.elements[fields[i]] !=null)
	    {
	      value = f.elements[fields[i]].value;
	      if (value != null)
	        s += "&" + fields[i] + "=" + value;
	    }
	  }
	}
	
	map2=null;
	page2=null;
	ov2=null;
	toolbar2=null;
	toc2=null;
	//alert(s);
	return s;
}

// checks if tool is available for client postback
function isForcePostBackTool(tool,toolstring) {
	//alert("tool: " + tool + "\ntoolstring: " + toolstring);
	var hasIt = false;
	if (toolstring!=null && toolstring!="") {
		var toollist = toolstring.split(",");
		for (var i=0;i<toollist.length;i++) {
			if (toollist[i]==tool) {
				hasIt = true;
				break;
			}
		}
	}
	return hasIt;
}

function tocAutoLayerVisibility(e, tocID) {
	var o;
	if (isNav && e != null)
		o = e.target;
	else
    o = window.event.srcElement;
  if (o.tagName == 'INPUT' && o.type == 'checkbox' && o.name != null && o.name.indexOf('CheckBox') > -1)
	{
	    //alert(o.state);
        o.state = o.checked;
        var req = "EventArg=Toc&" + o.value + "&state=" + o.checked; 
        eval('CallServer_' + tocID + '(req,"");');
	}
}

function resizeContentsFunction(win){
    
	if (win.contentsObject!=null) {
		if (win.contentsObject.resize!=null) //map, overviewmap, pagelayout
			win.contentsObject.resize(win.width, win.height); 
	}
}

function checkForClientPostbackEventArgs(eventArg) {
	//retValue = false;
	for (var i=0;i<clientPostbackEventArgs.length;i++) {
		if (eventArg.toLowerCase().indexOf(clientPostbackEventArgs[i].toLowerCase())!=-1) return true;
	}
	return false;
}

//END ESRI.ArcGIS.ADF.Web.UI.WebControls.Runtime.JavaScript.display_dotnetadf.js
//START ESRI.ArcGIS.ADF.Web.UI.WebControls.Runtime.JavaScript.ESRI.ADF.UI.Toolbar.release.js
//----------------------------------------------------------
// Copyright (C) ESRI. All rights reserved.
//----------------------------------------------------------
Type.registerNamespace('ESRI.ADF.UI');var Toolbars = [];var ToolbarGroups = [];var ToolbarName = [];ESRI.ADF.UI.Toolbar = function(element) { 
ESRI.ADF.UI.Toolbar.initializeBase(this, [element]);this._map = null;this._buddies = null;this._enabled = false;this._toolbarExtentChangedHandler = Function.createDelegate(this,this._toolbarExtentChanged);}
ESRI.ADF.UI.Toolbar.prototype = {
dispose : function() {
$clearHandlers(this._element);this._clearBuddyHandlers();ESRI.ADF.UI.Toolbar.callBaseMethod(this, 'dispose');},
_setupBuddyHandlers : function() { 
if (this._buddies != null) {
for (var i=0;i < this._buddies.length;i++) {
var component = $find(this._buddies[i]);if (component != null && ESRI.ADF.UI.MapBase.isInstanceOfType(component)) {
component.add_extentChanged(this._toolbarExtentChangedHandler);}
}
this._enabled = true;}
},
_clearBuddyHandlers : function() {
if (this._enabled && this._buddies != null) {
for (var i=0;i < this._buddies.length;i++)
{
var map = $find(this._buddies[i]);if (map != null && ESRI.ADF.UI.MapBase.isInstanceOfType(map)) {
map.remove_extentChanged(this._toolbarExtentChangedHandler);}
}
this._enabled = false;}
},
_toolbarExtentChanged : function(sender, eventArgs) {
var map = sender;var toolbar = Toolbars[this.get_element().id];if (toolbar == null) return;var backButton = toolbar.items[toolbar.btnMapBack];if (backButton) { backButton.disabled = false;}
var forwardButton = toolbar.items[toolbar.btnMapForward];if (forwardButton) { forwardButton.disabled = true;}
toolbar.refreshCommands();},
toolbarMapHistory : function(toolbarID, mapIDs, toolbarItemName, step) {
var toolbar = Toolbars[toolbarID];if (toolbar == null) return;var moreHistory = false;var toolbarBuddies = mapIDs.split(",");for (var i = 0;i < toolbarBuddies.length;i++) {
var map = $find(toolbarBuddies[i]);if (map) { moreHistory = map.stepExtentHistory(step);}
if (step < 0)
{ 
var backButton = toolbar.items[toolbarItemName];var forwardButton = toolbar.items[backButton.buddyItem];if (forwardButton) { forwardButton.disabled = false;}
if (!moreHistory) { backButton.disabled = true;}
}
else
{ 
var forwardButton = toolbar.items[toolbarItemName];var backButton = toolbar.items[forwardButton.buddyItem];if (backButton) { backButton.disabled = false;}
if (!moreHistory) { forwardButton.disabled = true;}
else { forwardButton.disabled = false;}
}
}
toolbar.refreshCommands();},
doCallback : function(argument, context) {
ESRI.ADF.System._doCallback(this._callbackFunctionString, this.get_uniqueID(), this.get_element().id, argument, context);},
processCallbackResult : function(action, params)
{
},
get_callbackFunctionString : function ()
{ 
return this._callbackFunctionString;},
set_callbackFunctionString : function(value)
{
if (this._callbackFunctionString != value) {
this._callbackFunctionString = value;this.raisePropertyChanged('callbackFunctionString');}
},
get_uniqueID : function ()
{ 
return this._uniqueID;},
set_uniqueID : function(value)
{
if (this._uniqueID != value) {
this._uniqueID = value;this.raisePropertyChanged('uniqueID');}
}, 
get_buddies : function ()
{ 
return this._buddies;},
set_buddies : function(value)
{
if (this._buddies != value) {
this._buddies = value;this._setupBuddyHandlers();this.raisePropertyChanged('buddies');}
},
get_map : function () {
},
set_map : function(value)
{
this._setupBuddyHandlers();},
add_onToolSelected : function(handler)
{
this.get_events().addHandler('onToolSelected', handler);},
remove_onToolSelected : function(handler)
{
this.get_events().removeHandler('onToolSelected', handler);}
}
ESRI.ADF.UI.Toolbar.registerClass('ESRI.ADF.UI.Toolbar', Sys.UI.Control);var esriClientActionFunction = null;/////////////////////////////////// Object Creation Functions /////////////////////////////////////
function ToolbarGroupObject(name, toolbars)
{
this.name = name;this.toolbars = toolbars.split(",");;}
function ToolbarItemObject(name, defaultImage, selectedImage, hoverImage, disabledImage, 
clientAction, isClientActionCustom, showLoading, disabled, buddyItem, selectAutoPostBack, cursor)
{
this.name = name;this.defaultImage = defaultImage;this.selectedImage = selectedImage;this.hoverImage = hoverImage;this.disabledImage = disabledImage;this.clientAction = clientAction;this.isClientActionCustom = isClientActionCustom;this.showLoading = showLoading;this.disabled = disabled;this.buddyItem = buddyItem;this.selectAutoPostBack = selectAutoPostBack;this.cursor = cursor;this.preExecFunction = null;}
function ToolbarObject(name, toolbarStyle, defaultStyle, selectedStyle, hoverStyle, disabledStyle, tools, commands, buddyControls, itemArray, group, currentToolField, callbackFunctionString)
{
this.name = name;this.toolbarStyle = toolbarStyle;this.defaultStyle = defaultStyle;this.selectedStyle = selectedStyle;this.hoverStyle = hoverStyle;this.disabledStyle = disabledStyle;this.tools = tools.split(",");this.commands = commands.split(",");if (buddyControls != "")
this.buddyControls = buddyControls.split(",");else
this.buddyControls = null;this.items = itemArray;this.group = group;this.currentToolField = currentToolField;this.enableClientPostBack = false;this.pageID = "";this.buttonsSupportingClientPostBack = "";this.document = document;this.btnMapBack = "";this.btnMapForward = "";if (callbackFunctionString!=null) 
this.callBackFunctionString = callbackFunctionString;else
this.callBackFunctionString = null;for (var i = 0;i < this.tools.length;i++)
{
var toolbarItemName = this.tools[i];if (toolbarItemName == "")
continue;var imageTag = this.name + toolbarItemName + "Image";var img = document.images[imageTag];if (img != null)
ESRI.ADF.System.setIEPngTransparency(img,img.src,true);}
for (var i = 0;i < this.commands.length;i++)
{
var toolbarItemName = this.commands[i];if (toolbarItemName == "")
continue;var imageTag = this.name + toolbarItemName + "Image";var img = document.images[imageTag];if (img != null)
ESRI.ADF.System.setIEPngTransparency(img,img.src,true);}
this.selectTool = function()
{
var f = document.forms[docFormID];var mode = f.elements[this.currentToolField].value;var selectedStyle = this.selectedStyle;var disabledStyle = this.disabledStyle;var style = this.defaultStyle;var tools = this.tools;var toolbarItemName,imageTag,cell;if (tools == null)
return;for (var i = 0;i < tools.length;i++)
{
toolbarItemName = tools[i];if (toolbarItemName == "")
continue;imageTag = this.name + toolbarItemName + "Image";cell = this.name + toolbarItemName;var toolbarItem = this.items[toolbarItemName];var cellElement = document.getElementById(cell);if ( cellElement == null || cellElement.style.display == "none")
continue;if (mode == toolbarItemName) 
{ 
cellElement.style.cssText = selectedStyle;if (this.toolbarStyle != "TextOnly")
{
var img = document.images[imageTag];switchImageSourceAndAlphaBlend(img,toolbarItem.selectedImage);}
}
else if (toolbarItem.disabled)
{
cellElement.style.cssText = disabledStyle;if (this.toolbarStyle != "TextOnly")
{
var img = document.images[imageTag];switchImageSourceAndAlphaBlend(img,toolbarItem.disabledImage);}
}
else
{
cellElement.style.cssText = style;if (this.toolbarStyle != "TextOnly")
{
var img = document.images[imageTag];switchImageSourceAndAlphaBlend(img,toolbarItem.defaultImage);}
}
}
}
this.refreshGroup = function()
{
var group = this.group;if (group == null || group == "")
return;var toolbarGroup = ToolbarGroups[group];if (toolbarGroup == null)
return;var toolbars = toolbarGroup.toolbars;if (toolbars == null)
return;for (var x = 0;x < toolbars.length;++x)
{
if (toolbars[x] != this.name)
{
Toolbars[toolbars[x]].selectTool();}
}
}
this.refreshCommands = function()
{
var f = document.forms[docFormID];var style = this.defaultStyle;var disabledStyle = this.disabledStyle;var commands = this.commands;var toolbarItemName,imageTag,cell;for (var i = 0;i < commands.length;i++)
{
toolbarItemName = commands[i];imageTag = this.name + toolbarItemName + "Image";cell = this.name + toolbarItemName;var toolbarItem = this.items[toolbarItemName];if (!toolbarItem)
continue;var cellElement = document.getElementById(cell);if ( cellElement == null || cellElement.style.display == "none")
continue;if (toolbarItem.disabled)
{
cellElement.style.cssText = disabledStyle;if (this.toolbarStyle != "TextOnly")
{
var img = document.images[imageTag];switchImageSourceAndAlphaBlend(img,toolbarItem.disabledImage);}
}
else
{
cellElement.style.cssText = style;if (this.toolbarStyle != "TextOnly")
{
var img = document.images[imageTag];switchImageSourceAndAlphaBlend(img,toolbarItem.defaultImage);}
}
}
}
}
/////////////////////////////////// Object Creation Functions /////////////////////////////////////
/////////////////////////////////// Mouse Action Functions /////////////////////////////////////
function ToolbarMouseDown(toolbarName, toolbarItemName, buttonType, e)
{
if (buttonType != "DropDownBox" && !isLeftButton(e))
return;var f = document.forms[docFormID];var imageTag = toolbarName + toolbarItemName + "Image";var cell = toolbarName + toolbarItemName;var toolbar = Toolbars[toolbarName];var toolbarComp = $find(toolbarName);if (toolbar === null || toolbarComp===null) return;if (toolbar.items[toolbarItemName].disabled) { return;}
if (buttonType == "Tool") {
f.elements[toolbar.currentToolField].value = toolbarItemName;var clientAction = toolbar.items[toolbarItemName].clientAction;if (clientAction != null) {
var clientActions = "";if (!toolbar.items[toolbarItemName].isClientActionCustom) {
var buddies = toolbar.buddyControls;if (buddies != null) {
for (var i = 0;i < buddies.length;i++)
{
var modeField = f.elements[buddies[i] + "_mode"];if (modeField != null)
modeField.value = toolbarItemName;var cursor = toolbar.items[toolbarItemName].cursor;if (cursor != null)
clientActions = clientActions + clientAction + " ( '" + buddies[i] + "' , '" + toolbarItemName + "', " + toolbar.items[toolbarItemName].showLoading + ",'" + cursor + "'); ";else
clientActions = clientActions + clientAction + " ( '" + buddies[i] + "' , '" + toolbarItemName + "', " + toolbar.items[toolbarItemName].showLoading + "); ";}
}
}
else
{
clientActions = clientAction;}
var tbObject = $find(toolbarName);if (tbObject!=null) {
var handler = tbObject.get_events().getHandler('onToolSelected');if(handler) 
handler(tbObject,{"name": toolbarItemName, "tool": toolbar.items[toolbarItemName]});}
if (toolbar.items[toolbarItemName].preExecFunction != null)
clientActions += toolbar.items[toolbarItemName].preExecFunction;var clientActionFunction = new Function(clientActions);clientActionFunction.call(null);Toolbars[toolbarName].selectTool();Toolbars[toolbarName].refreshGroup();}
}
else if (buttonType == "Command")
{
if (toolbar.items[toolbarItemName].preExecFunction != null)
eval(toolbar.items[toolbarItemName].preExecFunction);document.body.style.cursor = "wait";Toolbars[toolbarName].refreshCommands();Toolbars[toolbarName].selectTool();var toolbarComp = $find(toolbarName);var cellElement = document.getElementById(cell);cellElement.style.cssText = toolbar.selectedStyle;if (toolbar.toolbarStyle != "TextOnly")
{
var img = document.images[imageTag];switchImageSourceAndAlphaBlend(img,toolbar.items[toolbarItemName].selectedImage);}
cellElement.focus();var clientAction = toolbar.items[toolbarItemName].clientAction;if (clientAction != null && clientAction.length>0) {
esriClientActionFunction = clientAction;window.setTimeout("eval(esriClientActionFunction);", 0);}
else {
var arg = 'eventArg='+toolbarItemName+'&ControlID='+toolbarName+'&ControlType=Toolbar&PageID='+toolbar.pageID;toolbarComp.doCallback(arg,toolbarComp);}
document.body.style.cursor = "default";}
else if (buttonType == "DropDownBox")
{
var selectDropDown = toolbarName + toolbarItemName + "DropDownBox";var selectValueField = toolbarName + toolbarItemName + "Value";var arg = 'eventArg='+toolbarItemName+'&ControlID='+toolbarName+'&ControlType=Toolbar&PageID='+toolbar.pageID+'&'+selectValueField+'='+f.elements[selectDropDown].value;toolbarComp.doCallback(arg,toolbarComp);}
}
function ToolbarMouseOver(toolbarName, toolbarItemName)
{
var imageTag = toolbarName + toolbarItemName + "Image";var cell = toolbarName + toolbarItemName;var toolbar = Toolbars[toolbarName];if (toolbar == null) return;var f = document.forms[docFormID];var cellElement = document.getElementById(cell);if (toolbar.items[toolbarItemName].disabled)
cellElement.style.cssText = toolbar.disabledStyle;else
cellElement.style.cssText = toolbar.hoverStyle;if (toolbar.toolbarStyle != "TextOnly")
{
var img = document.images[imageTag];if (toolbar.items[toolbarItemName].disabled)
switchImageSourceAndAlphaBlend(img,toolbar.items[toolbarItemName].disabledImage);else
switchImageSourceAndAlphaBlend(img,toolbar.items[toolbarItemName].hoverImage);}
}
function ToolbarMouseOut(toolbarName, toolbarItemName) 
{
var toolbar = Toolbars[toolbarName];if (toolbar == null) return;var control = toolbar.tools[0];var f = document.forms[docFormID];var mode = f.elements[toolbar.currentToolField].value;var imageTag = toolbarName + toolbarItemName + "Image";var cell = toolbarName + toolbarItemName;var style, image;if (mode == toolbarItemName) 
{
style = toolbar.selectedStyle;image = toolbar.items[toolbarItemName].selectedImage;}
else
{
style = toolbar.defaultStyle;image = toolbar.items[toolbarItemName].defaultImage;}
if (toolbar.items[toolbarItemName].disabled)
{
style = toolbar.disabledStyle;image = toolbar.items[toolbarItemName].disabledImage;}
var cellElement = document.getElementById(cell);cellElement.style.cssText = style;if (toolbar.toolbarStyle != "TextOnly")
{
var img = document.images[imageTag];switchImageSourceAndAlphaBlend(img,image);}
}
if (typeof(Sys) !== 'undefined') Sys.Application.notifyScriptLoaded();
//END ESRI.ArcGIS.ADF.Web.UI.WebControls.Runtime.JavaScript.ESRI.ADF.UI.Toolbar.release.js
//START AjaxControlToolkit.Compat.Timer.Timer.js
Sys.Timer=function(){var a=this;Sys.Timer.initializeBase(a);a._interval=1e3;a._enabled=false;a._timer=null};Sys.Timer.prototype={get_interval:function(){return this._interval},set_interval:function(b){var a=this;if(a._interval!==b){a._interval=b;a.raisePropertyChanged("interval");if(!a.get_isUpdating()&&a._timer!==null){a._stopTimer();a._startTimer()}}},get_enabled:function(){return this._enabled},set_enabled:function(b){var a=this;if(b!==a.get_enabled()){a._enabled=b;a.raisePropertyChanged("enabled");if(!a.get_isUpdating())if(b)a._startTimer();else a._stopTimer()}},add_tick:function(a){this.get_events().addHandler("tick",a)},remove_tick:function(a){this.get_events().removeHandler("tick",a)},dispose:function(){this.set_enabled(false);this._stopTimer();Sys.Timer.callBaseMethod(this,"dispose")},updated:function(){var a=this;Sys.Timer.callBaseMethod(a,"updated");if(a._enabled){a._stopTimer();a._startTimer()}},_timerCallback:function(){var a=this.get_events().getHandler("tick");if(a)a(this,Sys.EventArgs.Empty)},_startTimer:function(){var a=this;a._timer=window.setInterval(Function.createDelegate(a,a._timerCallback),a._interval)},_stopTimer:function(){window.clearInterval(this._timer);this._timer=null}};Sys.Timer.descriptor={properties:[{name:"interval",type:Number},{name:"enabled",type:Boolean}],events:[{name:"tick"}]};Sys.Timer.registerClass("Sys.Timer",Sys.Component);
//END AjaxControlToolkit.Compat.Timer.Timer.js
//START AjaxControlToolkit.Common.Common.js
Type.registerNamespace("AjaxControlToolkit");AjaxControlToolkit.BoxSide=function(){};AjaxControlToolkit.BoxSide.prototype={Top:0,Right:1,Bottom:2,Left:3};AjaxControlToolkit.BoxSide.registerEnum("AjaxControlToolkit.BoxSide",false);AjaxControlToolkit._CommonToolkitScripts=function(){};AjaxControlToolkit._CommonToolkitScripts.prototype={_borderStyleNames:["borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle"],_borderWidthNames:["borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth"],_paddingWidthNames:["paddingTop","paddingRight","paddingBottom","paddingLeft"],_marginWidthNames:["marginTop","marginRight","marginBottom","marginLeft"],getCurrentStyle:function(b,c,d){var e="undefined",a=null;if(b){if(b.currentStyle)a=b.currentStyle[c];else if(document.defaultView&&document.defaultView.getComputedStyle){var f=document.defaultView.getComputedStyle(b,null);if(f)a=f[c]}if(!a&&b.style.getPropertyValue)a=b.style.getPropertyValue(c);else if(!a&&b.style.getAttribute)a=b.style.getAttribute(c)}if(!a||a==""||typeof a===e)if(typeof d!=e)a=d;else a=null;return a},getInheritedBackgroundColor:function(b){var d="backgroundColor",c="#FFFFFF";if(!b)return c;var a=this.getCurrentStyle(b,d);try{while(!a||a==""||a=="transparent"||a=="rgba(0, 0, 0, 0)"){b=b.parentNode;if(!b)a=c;else a=this.getCurrentStyle(b,d)}}catch(e){a=c}return a},getLocation:function(a){if(a===document.documentElement)return new Sys.UI.Point(0,0);if(Sys.Browser.agent==Sys.Browser.InternetExplorer&&Sys.Browser.version<7){if(a.window===a||a.nodeType===9||!a.getClientRects||!a.getBoundingClientRect)return new Sys.UI.Point(0,0);var b=a.getClientRects();if(!b||!b.length)return new Sys.UI.Point(0,0);var c=b[0],k=0,l=0,f=false;try{f=a.ownerDocument.parentWindow.frameElement}catch(m){f=true}if(f){var e=a.getBoundingClientRect();if(!e)return new Sys.UI.Point(0,0);var g=c.left,h=c.top;for(var i=1;i<b.length;i++){var d=b[i];if(d.left<g)g=d.left;if(d.top<h)h=d.top}k=g-e.left;l=h-e.top}var j=a.document.documentElement;return new Sys.UI.Point(c.left-2-k+j.scrollLeft,c.top-2-l+j.scrollTop)}return Sys.UI.DomElement.getLocation(a)},setLocation:function(b,a){Sys.UI.DomElement.setLocation(b,a.x,a.y)},getContentSize:function(a){if(!a)throw Error.argumentNull("element");var d=this.getSize(a),c=this.getBorderBox(a),b=this.getPaddingBox(a);return {width:d.width-c.horizontal-b.horizontal,height:d.height-c.vertical-b.vertical}},getSize:function(a){if(!a)throw Error.argumentNull("element");return {width:a.offsetWidth,height:a.offsetHeight}},setContentSize:function(a,b){var d="border-box",c=this;if(!a)throw Error.argumentNull("element");if(!b)throw Error.argumentNull("size");if(c.getCurrentStyle(a,"MozBoxSizing")==d||c.getCurrentStyle(a,"BoxSizing")==d){var f=c.getBorderBox(a),e=c.getPaddingBox(a);b={width:b.width+f.horizontal+e.horizontal,height:b.height+f.vertical+e.vertical}}a.style.width=b.width.toString()+"px";a.style.height=b.height.toString()+"px"},setSize:function(a,b){if(!a)throw Error.argumentNull("element");if(!b)throw Error.argumentNull("size");var d=this.getBorderBox(a),c=this.getPaddingBox(a),e={width:b.width-d.horizontal-c.horizontal,height:b.height-d.vertical-c.vertical};this.setContentSize(a,e)},getBounds:function(a){var b=$common.getLocation(a);return new Sys.UI.Bounds(b.x,b.y,a.offsetWidth||0,a.offsetHeight||0)},setBounds:function(a,b){if(!a)throw Error.argumentNull("element");if(!b)throw Error.argumentNull("bounds");this.setSize(a,b);$common.setLocation(a,b)},getClientBounds:function(){var b,a;if(document.compatMode=="CSS1Compat"){b=document.documentElement.clientWidth;a=document.documentElement.clientHeight}else{b=document.body.clientWidth;a=document.body.clientHeight}return new Sys.UI.Bounds(0,0,b,a)},getMarginBox:function(b){var c=this;if(!b)throw Error.argumentNull("element");var a={top:c.getMargin(b,AjaxControlToolkit.BoxSide.Top),right:c.getMargin(b,AjaxControlToolkit.BoxSide.Right),bottom:c.getMargin(b,AjaxControlToolkit.BoxSide.Bottom),left:c.getMargin(b,AjaxControlToolkit.BoxSide.Left)};a.horizontal=a.left+a.right;a.vertical=a.top+a.bottom;return a},getBorderBox:function(b){var c=this;if(!b)throw Error.argumentNull("element");var a={top:c.getBorderWidth(b,AjaxControlToolkit.BoxSide.Top),right:c.getBorderWidth(b,AjaxControlToolkit.BoxSide.Right),bottom:c.getBorderWidth(b,AjaxControlToolkit.BoxSide.Bottom),left:c.getBorderWidth(b,AjaxControlToolkit.BoxSide.Left)};a.horizontal=a.left+a.right;a.vertical=a.top+a.bottom;return a},getPaddingBox:function(b){var c=this;if(!b)throw Error.argumentNull("element");var a={top:c.getPadding(b,AjaxControlToolkit.BoxSide.Top),right:c.getPadding(b,AjaxControlToolkit.BoxSide.Right),bottom:c.getPadding(b,AjaxControlToolkit.BoxSide.Bottom),left:c.getPadding(b,AjaxControlToolkit.BoxSide.Left)};a.horizontal=a.left+a.right;a.vertical=a.top+a.bottom;return a},isBorderVisible:function(b,a){if(!b)throw Error.argumentNull("element");if(a<AjaxControlToolkit.BoxSide.Top||a>AjaxControlToolkit.BoxSide.Left)throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue,a,"AjaxControlToolkit.BoxSide"));var d=this._borderStyleNames[a],c=this.getCurrentStyle(b,d);return c!="none"},getMargin:function(b,a){if(!b)throw Error.argumentNull("element");if(a<AjaxControlToolkit.BoxSide.Top||a>AjaxControlToolkit.BoxSide.Left)throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue,a,"AjaxControlToolkit.BoxSide"));var d=this._marginWidthNames[a],c=this.getCurrentStyle(b,d);try{return this.parsePadding(c)}catch(e){return 0}},getBorderWidth:function(c,a){var b=this;if(!c)throw Error.argumentNull("element");if(a<AjaxControlToolkit.BoxSide.Top||a>AjaxControlToolkit.BoxSide.Left)throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue,a,"AjaxControlToolkit.BoxSide"));if(!b.isBorderVisible(c,a))return 0;var e=b._borderWidthNames[a],d=b.getCurrentStyle(c,e);return b.parseBorderWidth(d)},getPadding:function(b,a){if(!b)throw Error.argumentNull("element");if(a<AjaxControlToolkit.BoxSide.Top||a>AjaxControlToolkit.BoxSide.Left)throw Error.argumentOutOfRange(String.format(Sys.Res.enumInvalidValue,a,"AjaxControlToolkit.BoxSide"));var d=this._paddingWidthNames[a],c=this.getCurrentStyle(b,d);return this.parsePadding(c)},parseBorderWidth:function(d){var h="thick",g="medium",f="thin",e=this;if(!e._borderThicknesses){var c={},a=document.createElement("div");a.style.visibility="hidden";a.style.position="absolute";a.style.fontSize="1px";document.body.appendChild(a);var b=document.createElement("div");b.style.height="0px";b.style.overflow="hidden";a.appendChild(b);var i=a.offsetHeight;b.style.borderTop="solid black";b.style.borderTopWidth=f;c[f]=a.offsetHeight-i;b.style.borderTopWidth=g;c[g]=a.offsetHeight-i;b.style.borderTopWidth=h;c[h]=a.offsetHeight-i;a.removeChild(b);document.body.removeChild(a);e._borderThicknesses=c}if(d){switch(d){case f:case g:case h:return e._borderThicknesses[d];case "inherit":return 0}var j=e.parseUnit(d);Sys.Debug.assert(j.type=="px",String.format(AjaxControlToolkit.Resources.Common_InvalidBorderWidthUnit,j.type));return j.size}return 0},parsePadding:function(a){if(a){if(a=="inherit")return 0;var b=this.parseUnit(a);Sys.Debug.assert(b.type=="px",String.format(AjaxControlToolkit.Resources.Common_InvalidPaddingUnit,b.type));return b.size}return 0},parseUnit:function(a){if(!a)throw Error.argumentNull("value");a=a.trim().toLowerCase();var g=a.length,c=-1;for(var f=0;f<g;f++){var b=a.substr(f,1);if((b<"0"||b>"9")&&b!="-"&&b!="."&&b!=",")break;c=f}if(c==-1)throw Error.create(AjaxControlToolkit.Resources.Common_UnitHasNoDigits);var e,d;if(c<g-1)e=a.substring(c+1).trim();else e="px";d=parseFloat(a.substr(0,c+1));if(e=="px")d=Math.floor(d);return {size:d,type:e}},getElementOpacity:function(a){if(!a)throw Error.argumentNull("element");var b=false,c;if(a.filters){var e=a.filters;if(e.length!==0){var d=e["DXImageTransform.Microsoft.Alpha"];if(d){c=d.opacity/100;b=true}}}else{c=this.getCurrentStyle(a,"opacity",1);b=true}if(b===false)return 1;return parseFloat(c)},setElementOpacity:function(a,b){if(!a)throw Error.argumentNull("element");if(a.filters){var e=a.filters,c=true;if(e.length!==0){var d=e["DXImageTransform.Microsoft.Alpha"];if(d){c=false;d.opacity=b*100}}if(c)a.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+b*100+")"}else a.style.opacity=b},getVisible:function(a){return a&&"none"!=$common.getCurrentStyle(a,"display")&&"hidden"!=$common.getCurrentStyle(a,"visibility")},setVisible:function(a,b){if(a&&b!=$common.getVisible(a)){if(b)if(a.style.removeAttribute)a.style.removeAttribute("display");else a.style.removeProperty("display");else a.style.display="none";a.style.visibility=b?"visible":"hidden"}},resolveFunction:function(value){if(value)if(value instanceof Function)return value;else if(String.isInstanceOfType(value)&&value.length>0){var func;if((func=window[value])instanceof Function)return func;else if((func=eval(value))instanceof Function)return func}return null},addCssClasses:function(c,b){for(var a=0;a<b.length;a++)Sys.UI.DomElement.addCssClass(c,b[a])},removeCssClasses:function(c,b){for(var a=0;a<b.length;a++)Sys.UI.DomElement.removeCssClass(c,b[a])},setStyle:function(a,b){$common.applyProperties(a.style,b)},removeHandlers:function(c,a){for(var b in a)$removeHandler(c,b,a[b])},overlaps:function(a,b){return a.x<b.x+b.width&&b.x<a.x+a.width&&a.y<b.y+b.height&&b.y<a.y+a.height},containsPoint:function(a,b,c){return b>=a.x&&b<a.x+a.width&&c>=a.y&&c<a.y+a.height},isKeyDigit:function(a){return 48<=a&&a<=57},isKeyNavigation:function(a){return Sys.UI.Key.left<=a&&a<=Sys.UI.Key.down},padLeft:function(c,b,d,a){return $common._pad(c,b||2,d||" ","l",a||false)},padRight:function(c,b,d,a){return $common._pad(c,b||2,d||" ","r",a||false)},_pad:function(c,b,h,e,g){c=c.toString();var f=c.length,d=new Sys.StringBuilder;if(e=="r")d.append(c);while(f<b){d.append(h);f++}if(e=="l")d.append(c);var a=d.toString();if(g&&a.length>b)if(e=="l")a=a.substr(a.length-b,b);else a=a.substr(0,b);return a},__DOMEvents:{focusin:{eventGroup:"UIEvents",init:function(a){a.initUIEvent("focusin",true,false,window,1)}},focusout:{eventGroup:"UIEvents",init:function(a){a.initUIEvent("focusout",true,false,window,1)}},activate:{eventGroup:"UIEvents",init:function(a){a.initUIEvent("activate",true,true,window,1)}},focus:{eventGroup:"UIEvents",init:function(a){a.initUIEvent("focus",false,false,window,1)}},blur:{eventGroup:"UIEvents",init:function(a){a.initUIEvent("blur",false,false,window,1)}},click:{eventGroup:"MouseEvents",init:function(c,a){var b=false;c.initMouseEvent("click",true,true,window,1,a.screenX||0,a.screenY||0,a.clientX||0,a.clientY||0,a.ctrlKey||b,a.altKey||b,a.shiftKey||b,a.metaKey||b,a.button||0,a.relatedTarget||null)}},dblclick:{eventGroup:"MouseEvents",init:function(c,a){var b=false;c.initMouseEvent("click",true,true,window,2,a.screenX||0,a.screenY||0,a.clientX||0,a.clientY||0,a.ctrlKey||b,a.altKey||b,a.shiftKey||b,a.metaKey||b,a.button||0,a.relatedTarget||null)}},mousedown:{eventGroup:"MouseEvents",init:function(c,a){var b=false;c.initMouseEvent("mousedown",true,true,window,1,a.screenX||0,a.screenY||0,a.clientX||0,a.clientY||0,a.ctrlKey||b,a.altKey||b,a.shiftKey||b,a.metaKey||b,a.button||0,a.relatedTarget||null)}},mouseup:{eventGroup:"MouseEvents",init:function(c,a){var b=false;c.initMouseEvent("mouseup",true,true,window,1,a.screenX||0,a.screenY||0,a.clientX||0,a.clientY||0,a.ctrlKey||b,a.altKey||b,a.shiftKey||b,a.metaKey||b,a.button||0,a.relatedTarget||null)}},mouseover:{eventGroup:"MouseEvents",init:function(c,a){var b=false;c.initMouseEvent("mouseover",true,true,window,1,a.screenX||0,a.screenY||0,a.clientX||0,a.clientY||0,a.ctrlKey||b,a.altKey||b,a.shiftKey||b,a.metaKey||b,a.button||0,a.relatedTarget||null)}},mousemove:{eventGroup:"MouseEvents",init:function(c,a){var b=false;c.initMouseEvent("mousemove",true,true,window,1,a.screenX||0,a.screenY||0,a.clientX||0,a.clientY||0,a.ctrlKey||b,a.altKey||b,a.shiftKey||b,a.metaKey||b,a.button||0,a.relatedTarget||null)}},mouseout:{eventGroup:"MouseEvents",init:function(c,a){var b=false;c.initMouseEvent("mousemove",true,true,window,1,a.screenX||0,a.screenY||0,a.clientX||0,a.clientY||0,a.ctrlKey||b,a.altKey||b,a.shiftKey||b,a.metaKey||b,a.button||0,a.relatedTarget||null)}},load:{eventGroup:"HTMLEvents",init:function(a){a.initEvent("load",false,false)}},unload:{eventGroup:"HTMLEvents",init:function(a){a.initEvent("unload",false,false)}},select:{eventGroup:"HTMLEvents",init:function(a){a.initEvent("select",true,false)}},change:{eventGroup:"HTMLEvents",init:function(a){a.initEvent("change",true,false)}},submit:{eventGroup:"HTMLEvents",init:function(a){a.initEvent("submit",true,true)}},reset:{eventGroup:"HTMLEvents",init:function(a){a.initEvent("reset",true,false)}},resize:{eventGroup:"HTMLEvents",init:function(a){a.initEvent("resize",true,false)}},scroll:{eventGroup:"HTMLEvents",init:function(a){a.initEvent("scroll",true,false)}}},tryFireRawEvent:function(a,b){try{if(a.fireEvent){a.fireEvent("on"+b.type,b);return true}else if(a.dispatchEvent){a.dispatchEvent(b);return true}}catch(c){}return false},tryFireEvent:function(e,d,c){try{if(document.createEventObject){var a=document.createEventObject();$common.applyProperties(a,c||{});e.fireEvent("on"+d,a);return true}else if(document.createEvent){var b=$common.__DOMEvents[d];if(b){var a=document.createEvent(b.eventGroup);b.init(a,c||{});e.dispatchEvent(a);return true}}}catch(a){}return false},wrapElement:function(a,b,c){var d=a.parentNode;d.replaceChild(b,a);(c||b).appendChild(a)},unwrapElement:function(b,a){var c=a.parentNode;if(c!=null){$common.removeElement(b);c.replaceChild(b,a)}},removeElement:function(a){var b=a.parentNode;if(b!=null)b.removeChild(a)},applyProperties:function(d,c){for(var b in c){var a=c[b];if(a!=null&&Object.getType(a)===Object){var e=d[b];$common.applyProperties(e,a)}else d[b]=a}},createElementFromTemplate:function(a,j,e){var c=null,b="undefined";if(typeof a.nameTable!=b){var g=a.nameTable;if(String.isInstanceOfType(g))g=e[g];if(g!=c)e=g}var l=c;if(typeof a.name!==b)l=a.name;var d=document.createElement(a.nodeName);if(typeof a.name!==b&&e)e[a.name]=d;if(typeof a.parent!==b&&j==c){var h=a.parent;if(String.isInstanceOfType(h))h=e[h];if(h!=c)j=h}if(typeof a.properties!==b&&a.properties!=c)$common.applyProperties(d,a.properties);if(typeof a.cssClasses!==b&&a.cssClasses!=c)$common.addCssClasses(d,a.cssClasses);if(typeof a.events!==b&&a.events!=c)$addHandlers(d,a.events);if(typeof a.visible!==b&&a.visible!=c)this.setVisible(d,a.visible);if(j)j.appendChild(d);if(typeof a.opacity!==b&&a.opacity!=c)$common.setElementOpacity(d,a.opacity);if(typeof a.children!==b&&a.children!=c)for(var k=0;k<a.children.length;k++){var m=a.children[k];$common.createElementFromTemplate(m,d,e)}var i=d;if(typeof a.contentPresenter!==b&&a.contentPresenter!=c)i=e[i];if(typeof a.content!==b&&a.content!=c){var f=a.content;if(String.isInstanceOfType(f))f=e[f];if(f.parentNode)$common.wrapElement(f,d,i);else i.appendChild(f)}return d},prepareHiddenElementForATDeviceUpdate:function(){var b="hiddenInputToUpdateATBuffer_CommonToolkitScripts",a=document.getElementById(b);if(!a){var a=document.createElement("input");a.setAttribute("type","hidden");a.setAttribute("value","1");a.setAttribute("id",b);a.setAttribute("name",b);if(document.forms[0])document.forms[0].appendChild(a)}},updateFormToRefreshATDeviceBuffer:function(){var b="value",a=document.getElementById("hiddenInputToUpdateATBuffer_CommonToolkitScripts");if(a)if(a.getAttribute(b)=="1")a.setAttribute(b,"0");else a.setAttribute(b,"1")}};var CommonToolkitScripts=AjaxControlToolkit.CommonToolkitScripts=new AjaxControlToolkit._CommonToolkitScripts,$common=CommonToolkitScripts;Sys.UI.DomElement.getVisible=$common.getVisible;Sys.UI.DomElement.setVisible=$common.setVisible;Sys.UI.Control.overlaps=$common.overlaps;AjaxControlToolkit._DomUtility=function(){};AjaxControlToolkit._DomUtility.prototype={isDescendant:function(c,b){for(var a=b.parentNode;a!=null;a=a.parentNode)if(a==c)return true;return false},isDescendantOrSelf:function(b,a){if(b===a)return true;return AjaxControlToolkit.DomUtility.isDescendant(b,a)},isAncestor:function(a,b){return AjaxControlToolkit.DomUtility.isDescendant(b,a)},isAncestorOrSelf:function(a,b){if(a===b)return true;return AjaxControlToolkit.DomUtility.isDescendant(b,a)},isSibling:function(d,c){var b=d.parentNode;for(var a=0;a<b.childNodes.length;a++)if(b.childNodes[a]==c)return true;return false}};AjaxControlToolkit._DomUtility.registerClass("AjaxControlToolkit._DomUtility");AjaxControlToolkit.DomUtility=new AjaxControlToolkit._DomUtility;AjaxControlToolkit.TextBoxWrapper=function(b){var a=this;AjaxControlToolkit.TextBoxWrapper.initializeBase(a,[b]);a._current=b.value;a._watermark=null;a._isWatermarked=false};AjaxControlToolkit.TextBoxWrapper.prototype={dispose:function(){this.get_element().AjaxControlToolkitTextBoxWrapper=null;AjaxControlToolkit.TextBoxWrapper.callBaseMethod(this,"dispose")},get_Current:function(){this._current=this.get_element().value;return this._current},set_Current:function(a){this._current=a;this._updateElement()},get_Value:function(){if(this.get_IsWatermarked())return "";else return this.get_Current()},set_Value:function(b){var a=this;a.set_Current(b);if(!b||0==b.length){if(null!=a._watermark)a.set_IsWatermarked(true)}else a.set_IsWatermarked(false)},get_Watermark:function(){return this._watermark},set_Watermark:function(a){this._watermark=a;this._updateElement()},get_IsWatermarked:function(){return this._isWatermarked},set_IsWatermarked:function(b){var a=this;if(a._isWatermarked!=b){a._isWatermarked=b;a._updateElement();a._raiseWatermarkChanged()}},_updateElement:function(){var a=this,b=a.get_element();if(a._isWatermarked){if(b.value!=a._watermark)b.value=a._watermark}else if(b.value!=a._current)b.value=a._current},add_WatermarkChanged:function(a){this.get_events().addHandler("WatermarkChanged",a)},remove_WatermarkChanged:function(a){this.get_events().removeHandler("WatermarkChanged",a)},_raiseWatermarkChanged:function(){var a=this.get_events().getHandler("WatermarkChanged");if(a)a(this,Sys.EventArgs.Empty)}};AjaxControlToolkit.TextBoxWrapper.get_Wrapper=function(a){if(null==a.AjaxControlToolkitTextBoxWrapper)a.AjaxControlToolkitTextBoxWrapper=new AjaxControlToolkit.TextBoxWrapper(a);return a.AjaxControlToolkitTextBoxWrapper};AjaxControlToolkit.TextBoxWrapper.registerClass("AjaxControlToolkit.TextBoxWrapper",Sys.UI.Behavior);AjaxControlToolkit.TextBoxWrapper.validatorGetValue=function(b){var a=$get(b);if(a&&a.AjaxControlToolkitTextBoxWrapper)return a.AjaxControlToolkitTextBoxWrapper.get_Value();return AjaxControlToolkit.TextBoxWrapper._originalValidatorGetValue(b)};if(typeof ValidatorGetValue=="function"){AjaxControlToolkit.TextBoxWrapper._originalValidatorGetValue=ValidatorGetValue;ValidatorGetValue=AjaxControlToolkit.TextBoxWrapper.validatorGetValue}if(Sys.CultureInfo.prototype._getAbbrMonthIndex)try{Sys.CultureInfo.prototype._getAbbrMonthIndex("")}catch(ex){Sys.CultureInfo.prototype._getAbbrMonthIndex=function(b){var a=this;if(!a._upperAbbrMonths)a._upperAbbrMonths=a._toUpperArray(a.dateTimeFormat.AbbreviatedMonthNames);return Array.indexOf(a._upperAbbrMonths,a._toUpper(b))};Sys.CultureInfo.CurrentCulture._getAbbrMonthIndex=Sys.CultureInfo.prototype._getAbbrMonthIndex;Sys.CultureInfo.InvariantCulture._getAbbrMonthIndex=Sys.CultureInfo.prototype._getAbbrMonthIndex};
//END AjaxControlToolkit.Common.Common.js
//START AjaxControlToolkit.Animation.Animations.js
Type.registerNamespace("AjaxControlToolkit.Animation");var $AA=AjaxControlToolkit.Animation;$AA.registerAnimation=function(b,a){if(a&&(a===$AA.Animation||a.inheritsFrom&&a.inheritsFrom($AA.Animation))){if(!$AA.__animations)$AA.__animations={};$AA.__animations[b.toLowerCase()]=a;a.play=function(){var b=new a;a.apply(b,arguments);b.initialize();var c=Function.createDelegate(b,function(){b.remove_ended(c);c=null;b.dispose()});b.add_ended(c);b.play()}}else throw Error.argumentType("type",a,$AA.Animation,AjaxControlToolkit.Resources.Animation_InvalidBaseType)};$AA.buildAnimation=function(a,c){if(!a||a==="")return null;var b;a="("+a+")";if(!Sys.Debug.isDebug)try{b=Sys.Serialization.JavaScriptSerializer.deserialize(a)}catch(d){}else b=Sys.Serialization.JavaScriptSerializer.deserialize(a);return $AA.createAnimation(b,c)};$AA.createAnimation=function(c,l){var g="obj";if(!c||!c.AnimationName)throw Error.argument(g,AjaxControlToolkit.Resources.Animation_MissingAnimationName);var b=$AA.__animations[c.AnimationName.toLowerCase()];if(!b)throw Error.argument("type",String.format(AjaxControlToolkit.Resources.Animation_UknownAnimationName,c.AnimationName));var d=new b;if(l)d.set_target(l);if(c.AnimationChildren&&c.AnimationChildren.length)if($AA.ParentAnimation.isInstanceOfType(d))for(var k=0;k<c.AnimationChildren.length;k++){var m=$AA.createAnimation(c.AnimationChildren[k]);if(m)d.add(m)}else throw Error.argument(g,String.format(AjaxControlToolkit.Resources.Animation_ChildrenNotAllowed,b.getName()));var h=b.__animationProperties;if(!h){b.__animationProperties={};b.resolveInheritance();for(var j in b.prototype)if(j.startsWith("set_"))b.__animationProperties[j.substr(4).toLowerCase()]=j;delete b.__animationProperties["id"];h=b.__animationProperties}for(var e in c){var f=e.toLowerCase();if(f=="animationname"||f=="animationchildren")continue;var i=c[e],a=h[f];if(a&&String.isInstanceOfType(a)&&d[a])if(!Sys.Debug.isDebug)try{d[a](i)}catch(n){}else d[a](i);else if(f.endsWith("script")){a=h[f.substr(0,e.length-6)];if(a&&String.isInstanceOfType(a)&&d[a])d.DynamicProperties[a]=i;else if(Sys.Debug.isDebug)throw Error.argument(g,String.format(AjaxControlToolkit.Resources.Animation_NoDynamicPropertyFound,e,e.substr(0,e.length-5)))}else if(Sys.Debug.isDebug)throw Error.argument(g,String.format(AjaxControlToolkit.Resources.Animation_NoPropertyFound,e))}return d};$AA.Animation=function(d,c,e){var b=null,a=this;$AA.Animation.initializeBase(a);a._duration=1;a._fps=25;a._target=b;a._tickHandler=b;a._timer=b;a._percentComplete=0;a._percentDelta=b;a._owner=b;a._parentAnimation=b;a.DynamicProperties={};if(d)a.set_target(d);if(c)a.set_duration(c);if(e)a.set_fps(e)};$AA.Animation.prototype={dispose:function(){var a=this;if(a._timer){a._timer.dispose();a._timer=null}a._tickHandler=null;a._target=null;$AA.Animation.callBaseMethod(a,"dispose")},play:function(){var a=this;if(!a._owner){var b=true;if(!a._timer){b=false;if(!a._tickHandler)a._tickHandler=Function.createDelegate(a,a._onTimerTick);a._timer=new Sys.Timer;a._timer.add_tick(a._tickHandler);a.onStart();a._timer.set_interval(1e3/a._fps);a._percentDelta=100/(a._duration*a._fps);a._updatePercentComplete(0,true)}a._timer.set_enabled(true);a.raisePropertyChanged("isPlaying");if(!b)a.raisePropertyChanged("isActive")}},pause:function(){var a=this;if(!a._owner)if(a._timer){a._timer.set_enabled(false);a.raisePropertyChanged("isPlaying")}},stop:function(b){var a=this;if(!a._owner){var c=a._timer;a._timer=null;if(c){c.dispose();if(a._percentComplete!==100){a._percentComplete=100;a.raisePropertyChanged("percentComplete");if(b||b===undefined)a.onStep(100)}a.onEnd();a.raisePropertyChanged("isPlaying");a.raisePropertyChanged("isActive")}}},onStart:function(){var a=this;a.raiseStarted();for(var property in a.DynamicProperties)try{a[property](eval(a.DynamicProperties[property]))}catch(ex){if(Sys.Debug.isDebug)throw ex}},onStep:function(a){this.setValue(this.getAnimatedValue(a));this.raiseStep()},onEnd:function(){this.raiseEnded()},getAnimatedValue:function(){throw Error.notImplemented()},setValue:function(){throw Error.notImplemented()},interpolate:function(a,c,b){return a+(c-a)*(b/100)},_onTimerTick:function(){this._updatePercentComplete(this._percentComplete+this._percentDelta,true)},_updatePercentComplete:function(a,c){var b=this;if(a>100)a=100;b._percentComplete=a;b.raisePropertyChanged("percentComplete");if(c)b.onStep(a);if(a===100)b.stop(false)},setOwner:function(a){this._owner=a},raiseStarted:function(){var a=this.get_events().getHandler("started");if(a)a(this,Sys.EventArgs.Empty)},add_started:function(a){this.get_events().addHandler("started",a)},remove_started:function(a){this.get_events().removeHandler("started",a)},raiseEnded:function(){var a=this.get_events().getHandler("ended");if(a)a(this,Sys.EventArgs.Empty)},add_ended:function(a){this.get_events().addHandler("ended",a)},remove_ended:function(a){this.get_events().removeHandler("ended",a)},raiseStep:function(){var a=this.get_events().getHandler("step");if(a)a(this,Sys.EventArgs.Empty)},add_step:function(a){this.get_events().addHandler("step",a)},remove_step:function(a){this.get_events().removeHandler("step",a)},get_target:function(){var a=this;if(!a._target&&a._parentAnimation)return a._parentAnimation.get_target();return a._target},set_target:function(a){if(this._target!=a){this._target=a;this.raisePropertyChanged("target")}},set_animationTarget:function(c){var b=null,a=$get(c);if(a)b=a;else{var d=$find(c);if(d){a=d.get_element();if(a)b=a}}if(b)this.set_target(b);else throw Error.argument("id",String.format(AjaxControlToolkit.Resources.Animation_TargetNotFound,c))},get_duration:function(){return this._duration},set_duration:function(b){var a=this;b=a._getFloat(b);if(a._duration!=b){a._duration=b;a.raisePropertyChanged("duration")}},get_fps:function(){return this._fps},set_fps:function(b){var a=this;b=a._getInteger(b);if(a.fps!=b){a._fps=b;a.raisePropertyChanged("fps")}},get_isActive:function(){return this._timer!==null},get_isPlaying:function(){return this._timer!==null&&this._timer.get_enabled()},get_percentComplete:function(){return this._percentComplete},_getBoolean:function(a){if(String.isInstanceOfType(a))return Boolean.parse(a);return a},_getInteger:function(a){if(String.isInstanceOfType(a))return parseInt(a);return a},_getFloat:function(a){if(String.isInstanceOfType(a))return parseFloat(a);return a},_getEnum:function(a,b){if(String.isInstanceOfType(a)&&b&&b.parse)return b.parse(a);return a}};$AA.Animation.registerClass("AjaxControlToolkit.Animation.Animation",Sys.Component);$AA.registerAnimation("animation",$AA.Animation);$AA.ParentAnimation=function(d,c,e,a){$AA.ParentAnimation.initializeBase(this,[d,c,e]);this._animations=[];if(a&&a.length)for(var b=0;b<a.length;b++)this.add(a[b])};$AA.ParentAnimation.prototype={initialize:function(){var a=this;$AA.ParentAnimation.callBaseMethod(a,"initialize");if(a._animations)for(var c=0;c<a._animations.length;c++){var b=a._animations[c];if(b&&!b.get_isInitialized)b.initialize()}},dispose:function(){this.clear();this._animations=null;$AA.ParentAnimation.callBaseMethod(this,"dispose")},get_animations:function(){return this._animations},add:function(b){var a=this;if(a._animations){if(b)b._parentAnimation=a;Array.add(a._animations,b);a.raisePropertyChanged("animations")}},remove:function(a){if(this._animations){if(a)a.dispose();Array.remove(this._animations,a);this.raisePropertyChanged("animations")}},removeAt:function(c){var a=this;if(a._animations){var b=a._animations[c];if(b)b.dispose();Array.removeAt(a._animations,c);a.raisePropertyChanged("animations")}},clear:function(){var a=this;if(a._animations){for(var b=a._animations.length-1;b>=0;b--){a._animations[b].dispose();a._animations[b]=null}Array.clear(a._animations);a._animations=[];a.raisePropertyChanged("animations")}}};$AA.ParentAnimation.registerClass("AjaxControlToolkit.Animation.ParentAnimation",$AA.Animation);$AA.registerAnimation("parent",$AA.ParentAnimation);$AA.ParallelAnimation=function(c,b,d,a){$AA.ParallelAnimation.initializeBase(this,[c,b,d,a])};$AA.ParallelAnimation.prototype={add:function(a){$AA.ParallelAnimation.callBaseMethod(this,"add",[a]);a.setOwner(this)},onStart:function(){$AA.ParallelAnimation.callBaseMethod(this,"onStart");var b=this.get_animations();for(var a=0;a<b.length;a++)b[a].onStart()},onStep:function(c){var b=this.get_animations();for(var a=0;a<b.length;a++)b[a].onStep(c)},onEnd:function(){var b=this.get_animations();for(var a=0;a<b.length;a++)b[a].onEnd();$AA.ParallelAnimation.callBaseMethod(this,"onEnd")}};$AA.ParallelAnimation.registerClass("AjaxControlToolkit.Animation.ParallelAnimation",$AA.ParentAnimation);$AA.registerAnimation("parallel",$AA.ParallelAnimation);$AA.SequenceAnimation=function(e,d,f,c,b){var a=this;$AA.SequenceAnimation.initializeBase(a,[e,d,f,c]);a._handler=null;a._paused=false;a._playing=false;a._index=0;a._remainingIterations=0;a._iterations=b!==undefined?b:1};$AA.SequenceAnimation.prototype={dispose:function(){this._handler=null;$AA.SequenceAnimation.callBaseMethod(this,"dispose")},stop:function(){var a=this;if(a._playing){var b=a.get_animations();if(a._index<b.length){b[a._index].remove_ended(a._handler);for(var c=a._index;c<b.length;c++)b[c].stop()}a._playing=false;a._paused=false;a.raisePropertyChanged("isPlaying");a.onEnd()}},pause:function(){var a=this;if(a.get_isPlaying()){var b=a.get_animations()[a._index];if(b!=null)b.pause();a._paused=true;a.raisePropertyChanged("isPlaying")}},play:function(){var c="isPlaying",a=this,d=a.get_animations();if(!a._playing){a._playing=true;if(a._paused){a._paused=false;var e=d[a._index];if(e!=null){e.play();a.raisePropertyChanged(c)}}else{a.onStart();a._index=0;var b=d[a._index];if(b){b.add_ended(a._handler);b.play();a.raisePropertyChanged(c)}else a.stop()}}},onStart:function(){var a=this;$AA.SequenceAnimation.callBaseMethod(a,"onStart");a._remainingIterations=a._iterations-1;if(!a._handler)a._handler=Function.createDelegate(a,a._onEndAnimation)},_onEndAnimation:function(){var a=this,b=a.get_animations(),c=b[a._index++];if(c)c.remove_ended(a._handler);if(a._index<b.length){var e=b[a._index];e.add_ended(a._handler);e.play()}else if(a._remainingIterations>=1||a._iterations<=0){a._remainingIterations--;a._index=0;var d=b[0];d.add_ended(a._handler);d.play()}else a.stop()},onStep:function(){throw Error.invalidOperation(AjaxControlToolkit.Resources.Animation_CannotNestSequence)},onEnd:function(){this._remainingIterations=0;$AA.SequenceAnimation.callBaseMethod(this,"onEnd")},get_isActive:function(){return true},get_isPlaying:function(){return this._playing&&!this._paused},get_iterations:function(){return this._iterations},set_iterations:function(b){var a=this;b=a._getInteger(b);if(a._iterations!=b){a._iterations=b;a.raisePropertyChanged("iterations")}},get_isInfinite:function(){return this._iterations<=0}};$AA.SequenceAnimation.registerClass("AjaxControlToolkit.Animation.SequenceAnimation",$AA.ParentAnimation);$AA.registerAnimation("sequence",$AA.SequenceAnimation);$AA.SelectionAnimation=function(c,b,d,a){$AA.SelectionAnimation.initializeBase(this,[c,b,d,a]);this._selectedIndex=-1;this._selected=null};$AA.SelectionAnimation.prototype={getSelectedIndex:function(){throw Error.notImplemented()},onStart:function(){var a=this;$AA.SelectionAnimation.callBaseMethod(a,"onStart");var b=a.get_animations();a._selectedIndex=a.getSelectedIndex();if(a._selectedIndex>=0&&a._selectedIndex<b.length){a._selected=b[a._selectedIndex];if(a._selected){a._selected.setOwner(a);a._selected.onStart()}}},onStep:function(a){if(this._selected)this._selected.onStep(a)},onEnd:function(){var a=this;if(a._selected){a._selected.onEnd();a._selected.setOwner(null)}a._selected=null;a._selectedIndex=null;$AA.SelectionAnimation.callBaseMethod(a,"onEnd")}};$AA.SelectionAnimation.registerClass("AjaxControlToolkit.Animation.SelectionAnimation",$AA.ParentAnimation);$AA.registerAnimation("selection",$AA.SelectionAnimation);$AA.ConditionAnimation=function(d,c,e,b,a){$AA.ConditionAnimation.initializeBase(this,[d,c,e,b]);this._conditionScript=a};$AA.ConditionAnimation.prototype={getSelectedIndex:function(){var selected=-1;if(this._conditionScript&&this._conditionScript.length>0)try{selected=eval(this._conditionScript)?0:1}catch(ex){}return selected},get_conditionScript:function(){return this._conditionScript},set_conditionScript:function(a){if(this._conditionScript!=a){this._conditionScript=a;this.raisePropertyChanged("conditionScript")}}};$AA.ConditionAnimation.registerClass("AjaxControlToolkit.Animation.ConditionAnimation",$AA.SelectionAnimation);$AA.registerAnimation("condition",$AA.ConditionAnimation);$AA.CaseAnimation=function(d,c,e,b,a){$AA.CaseAnimation.initializeBase(this,[d,c,e,b]);this._selectScript=a};$AA.CaseAnimation.prototype={getSelectedIndex:function(){var selected=-1;if(this._selectScript&&this._selectScript.length>0)try{var result=eval(this._selectScript);if(result!==undefined)selected=result}catch(ex){}return selected},get_selectScript:function(){return this._selectScript},set_selectScript:function(a){if(this._selectScript!=a){this._selectScript=a;this.raisePropertyChanged("selectScript")}}};$AA.CaseAnimation.registerClass("AjaxControlToolkit.Animation.CaseAnimation",$AA.SelectionAnimation);$AA.registerAnimation("case",$AA.CaseAnimation);$AA.FadeEffect=function(){throw Error.invalidOperation()};$AA.FadeEffect.prototype={FadeIn:0,FadeOut:1};$AA.FadeEffect.registerEnum("AjaxControlToolkit.Animation.FadeEffect",false);$AA.FadeAnimation=function(g,f,h,e,d,c,b){var a=this;$AA.FadeAnimation.initializeBase(a,[g,f,h]);a._effect=e!==undefined?e:$AA.FadeEffect.FadeIn;a._max=c!==undefined?c:1;a._min=d!==undefined?d:0;a._start=a._min;a._end=a._max;a._layoutCreated=false;a._forceLayoutInIE=b===undefined||b===null?true:b;a._currentTarget=null;a._resetOpacities()};$AA.FadeAnimation.prototype={_resetOpacities:function(){var a=this;if(a._effect==$AA.FadeEffect.FadeIn){a._start=a._min;a._end=a._max}else{a._start=a._max;a._end=a._min}},_createLayout:function(){var a=this,b=a._currentTarget;if(b){a._originalWidth=$common.getCurrentStyle(b,"width");var c=$common.getCurrentStyle(b,"height");a._originalBackColor=$common.getCurrentStyle(b,"backgroundColor");if((!a._originalWidth||a._originalWidth==""||a._originalWidth=="auto")&&(!c||c==""||c=="auto"))b.style.width=b.offsetWidth+"px";if(!a._originalBackColor||a._originalBackColor==""||a._originalBackColor=="transparent"||a._originalBackColor=="rgba(0, 0, 0, 0)")b.style.backgroundColor=$common.getInheritedBackgroundColor(b);a._layoutCreated=true}},onStart:function(){var a=this;$AA.FadeAnimation.callBaseMethod(a,"onStart");a._currentTarget=a.get_target();a.setValue(a._start);if(a._forceLayoutInIE&&!a._layoutCreated&&Sys.Browser.agent==Sys.Browser.InternetExplorer)a._createLayout()},getAnimatedValue:function(a){return this.interpolate(this._start,this._end,a)},setValue:function(a){if(this._currentTarget)$common.setElementOpacity(this._currentTarget,a)},get_effect:function(){return this._effect},set_effect:function(b){var a=this;b=a._getEnum(b,$AA.FadeEffect);if(a._effect!=b){a._effect=b;a._resetOpacities();a.raisePropertyChanged("effect")}},get_minimumOpacity:function(){return this._min},set_minimumOpacity:function(b){var a=this;b=a._getFloat(b);if(a._min!=b){a._min=b;a._resetOpacities();a.raisePropertyChanged("minimumOpacity")}},get_maximumOpacity:function(){return this._max},set_maximumOpacity:function(b){var a=this;b=a._getFloat(b);if(a._max!=b){a._max=b;a._resetOpacities();a.raisePropertyChanged("maximumOpacity")}},get_forceLayoutInIE:function(){return this._forceLayoutInIE},set_forceLayoutInIE:function(b){var a=this;b=a._getBoolean(b);if(a._forceLayoutInIE!=b){a._forceLayoutInIE=b;a.raisePropertyChanged("forceLayoutInIE")}},set_startValue:function(a){a=this._getFloat(a);this._start=a}};$AA.FadeAnimation.registerClass("AjaxControlToolkit.Animation.FadeAnimation",$AA.Animation);$AA.registerAnimation("fade",$AA.FadeAnimation);$AA.FadeInAnimation=function(e,d,f,c,b,a){$AA.FadeInAnimation.initializeBase(this,[e,d,f,$AA.FadeEffect.FadeIn,c,b,a])};$AA.FadeInAnimation.prototype={onStart:function(){var a=this;$AA.FadeInAnimation.callBaseMethod(a,"onStart");if(a._currentTarget)a.set_startValue($common.getElementOpacity(a._currentTarget))}};$AA.FadeInAnimation.registerClass("AjaxControlToolkit.Animation.FadeInAnimation",$AA.FadeAnimation);$AA.registerAnimation("fadeIn",$AA.FadeInAnimation);$AA.FadeOutAnimation=function(e,d,f,c,b,a){$AA.FadeOutAnimation.initializeBase(this,[e,d,f,$AA.FadeEffect.FadeOut,c,b,a])};$AA.FadeOutAnimation.prototype={onStart:function(){var a=this;$AA.FadeOutAnimation.callBaseMethod(a,"onStart");if(a._currentTarget)a.set_startValue($common.getElementOpacity(a._currentTarget))}};$AA.FadeOutAnimation.registerClass("AjaxControlToolkit.Animation.FadeOutAnimation",$AA.FadeAnimation);$AA.registerAnimation("fadeOut",$AA.FadeOutAnimation);$AA.PulseAnimation=function(c,b,d,h,g,f,e){var a=this;$AA.PulseAnimation.initializeBase(a,[c,b,d,null,h!==undefined?h:3]);a._out=new $AA.FadeOutAnimation(c,b,d,g,f,e);a.add(a._out);a._in=new $AA.FadeInAnimation(c,b,d,g,f,e);a.add(a._in)};$AA.PulseAnimation.prototype={get_minimumOpacity:function(){return this._out.get_minimumOpacity()},set_minimumOpacity:function(b){var a=this;b=a._getFloat(b);a._out.set_minimumOpacity(b);a._in.set_minimumOpacity(b);a.raisePropertyChanged("minimumOpacity")},get_maximumOpacity:function(){return this._out.get_maximumOpacity()},set_maximumOpacity:function(b){var a=this;b=a._getFloat(b);a._out.set_maximumOpacity(b);a._in.set_maximumOpacity(b);a.raisePropertyChanged("maximumOpacity")},get_forceLayoutInIE:function(){return this._out.get_forceLayoutInIE()},set_forceLayoutInIE:function(b){var a=this;b=a._getBoolean(b);a._out.set_forceLayoutInIE(b);a._in.set_forceLayoutInIE(b);a.raisePropertyChanged("forceLayoutInIE")},set_duration:function(a){var b=this;a=b._getFloat(a);$AA.PulseAnimation.callBaseMethod(b,"set_duration",[a]);b._in.set_duration(a);b._out.set_duration(a)},set_fps:function(a){var b=this;a=b._getInteger(a);$AA.PulseAnimation.callBaseMethod(b,"set_fps",[a]);b._in.set_fps(a);b._out.set_fps(a)}};$AA.PulseAnimation.registerClass("AjaxControlToolkit.Animation.PulseAnimation",$AA.SequenceAnimation);$AA.registerAnimation("pulse",$AA.PulseAnimation);$AA.PropertyAnimation=function(e,c,f,d,b){var a=this;$AA.PropertyAnimation.initializeBase(a,[e,c,f]);a._property=d;a._propertyKey=b;a._currentTarget=null};$AA.PropertyAnimation.prototype={onStart:function(){$AA.PropertyAnimation.callBaseMethod(this,"onStart");this._currentTarget=this.get_target()},setValue:function(c){var a=this,b=a._currentTarget;if(b&&a._property&&a._property.length>0)if(a._propertyKey&&a._propertyKey.length>0&&b[a._property])b[a._property][a._propertyKey]=c;else b[a._property]=c},getValue:function(){var a=this,c=a.get_target();if(c&&a._property&&a._property.length>0){var b=c[a._property];if(b){if(a._propertyKey&&a._propertyKey.length>0)return b[a._propertyKey];return b}}return null},get_property:function(){return this._property},set_property:function(a){if(this._property!=a){this._property=a;this.raisePropertyChanged("property")}},get_propertyKey:function(){return this._propertyKey},set_propertyKey:function(a){if(this._propertyKey!=a){this._propertyKey=a;this.raisePropertyChanged("propertyKey")}}};$AA.PropertyAnimation.registerClass("AjaxControlToolkit.Animation.PropertyAnimation",$AA.Animation);$AA.registerAnimation("property",$AA.PropertyAnimation);$AA.DiscreteAnimation=function(e,c,f,d,b,a){$AA.DiscreteAnimation.initializeBase(this,[e,c,f,d,b]);this._values=a&&a.length?a:[]};$AA.DiscreteAnimation.prototype={getAnimatedValue:function(a){var b=Math.floor(this.interpolate(0,this._values.length-1,a));return this._values[b]},get_values:function(){return this._values},set_values:function(a){if(this._values!=a){this._values=a;this.raisePropertyChanged("values")}}};$AA.DiscreteAnimation.registerClass("AjaxControlToolkit.Animation.DiscreteAnimation",$AA.PropertyAnimation);$AA.registerAnimation("discrete",$AA.DiscreteAnimation);$AA.InterpolatedAnimation=function(f,d,g,a,b,c,e){$AA.InterpolatedAnimation.initializeBase(this,[f,d,g,a!==undefined?a:"style",b]);this._startValue=c;this._endValue=e};$AA.InterpolatedAnimation.prototype={get_startValue:function(){return this._startValue},set_startValue:function(b){var a=this;b=a._getFloat(b);if(a._startValue!=b){a._startValue=b;a.raisePropertyChanged("startValue")}},get_endValue:function(){return this._endValue},set_endValue:function(b){var a=this;b=a._getFloat(b);if(a._endValue!=b){a._endValue=b;a.raisePropertyChanged("endValue")}}};$AA.InterpolatedAnimation.registerClass("AjaxControlToolkit.Animation.InterpolatedAnimation",$AA.PropertyAnimation);$AA.registerAnimation("interpolated",$AA.InterpolatedAnimation);$AA.ColorAnimation=function(g,d,h,f,b,c,e){var a=this;$AA.ColorAnimation.initializeBase(a,[g,d,h,f,b,c,e]);a._start=null;a._end=null;a._interpolateRed=false;a._interpolateGreen=false;a._interpolateBlue=false};$AA.ColorAnimation.prototype={onStart:function(){var a=this;$AA.ColorAnimation.callBaseMethod(a,"onStart");a._start=$AA.ColorAnimation.getRGB(a.get_startValue());a._end=$AA.ColorAnimation.getRGB(a.get_endValue());a._interpolateRed=a._start.Red!=a._end.Red;a._interpolateGreen=a._start.Green!=a._end.Green;a._interpolateBlue=a._start.Blue!=a._end.Blue},getAnimatedValue:function(b){var a=this,e=a._start.Red,d=a._start.Green,c=a._start.Blue;if(a._interpolateRed)e=Math.round(a.interpolate(e,a._end.Red,b));if(a._interpolateGreen)d=Math.round(a.interpolate(d,a._end.Green,b));if(a._interpolateBlue)c=Math.round(a.interpolate(c,a._end.Blue,b));return $AA.ColorAnimation.toColor(e,d,c)},set_startValue:function(a){if(this._startValue!=a){this._startValue=a;this.raisePropertyChanged("startValue")}},set_endValue:function(a){if(this._endValue!=a){this._endValue=a;this.raisePropertyChanged("endValue")}}};$AA.ColorAnimation.getRGB=function(a){if(!a||a.length!=7)throw String.format(AjaxControlToolkit.Resources.Animation_InvalidColor,a);return {Red:parseInt(a.substr(1,2),16),Green:parseInt(a.substr(3,2),16),Blue:parseInt(a.substr(5,2),16)}};$AA.ColorAnimation.toColor=function(f,d,e){var c=f.toString(16),b=d.toString(16),a=e.toString(16);if(c.length==1)c="0"+c;if(b.length==1)b="0"+b;if(a.length==1)a="0"+a;return "#"+c+b+a};$AA.ColorAnimation.registerClass("AjaxControlToolkit.Animation.ColorAnimation",$AA.InterpolatedAnimation);$AA.registerAnimation("color",$AA.ColorAnimation);$AA.LengthAnimation=function(g,d,h,f,b,c,e,a){$AA.LengthAnimation.initializeBase(this,[g,d,h,f,b,c,e]);this._unit=a!=null?a:"px"};$AA.LengthAnimation.prototype={getAnimatedValue:function(b){var a=this,c=a.interpolate(a.get_startValue(),a.get_endValue(),b);return Math.round(c)+a._unit},get_unit:function(){return this._unit},set_unit:function(a){if(this._unit!=a){this._unit=a;this.raisePropertyChanged("unit")}}};$AA.LengthAnimation.registerClass("AjaxControlToolkit.Animation.LengthAnimation",$AA.InterpolatedAnimation);$AA.registerAnimation("length",$AA.LengthAnimation);$AA.MoveAnimation=function(d,c,e,f,h,g,i){var b=null,a=this;$AA.MoveAnimation.initializeBase(a,[d,c,e,b]);a._horizontal=f?f:0;a._vertical=h?h:0;a._relative=g===undefined?true:g;a._horizontalAnimation=new $AA.LengthAnimation(d,c,e,"style","left",b,b,i);a._verticalAnimation=new $AA.LengthAnimation(d,c,e,"style","top",b,b,i);a.add(a._verticalAnimation);a.add(a._horizontalAnimation)};$AA.MoveAnimation.prototype={onStart:function(){var a=this;$AA.MoveAnimation.callBaseMethod(a,"onStart");var b=a.get_target();a._horizontalAnimation.set_startValue(b.offsetLeft);a._horizontalAnimation.set_endValue(a._relative?b.offsetLeft+a._horizontal:a._horizontal);a._verticalAnimation.set_startValue(b.offsetTop);a._verticalAnimation.set_endValue(a._relative?b.offsetTop+a._vertical:a._vertical)},get_horizontal:function(){return this._horizontal},set_horizontal:function(b){var a=this;b=a._getFloat(b);if(a._horizontal!=b){a._horizontal=b;a.raisePropertyChanged("horizontal")}},get_vertical:function(){return this._vertical},set_vertical:function(b){var a=this;b=a._getFloat(b);if(a._vertical!=b){a._vertical=b;a.raisePropertyChanged("vertical")}},get_relative:function(){return this._relative},set_relative:function(b){var a=this;b=a._getBoolean(b);if(a._relative!=b){a._relative=b;a.raisePropertyChanged("relative")}},get_unit:function(){this._horizontalAnimation.get_unit()},set_unit:function(b){var a=this,c=a._horizontalAnimation.get_unit();if(c!=b){a._horizontalAnimation.set_unit(b);a._verticalAnimation.set_unit(b);a.raisePropertyChanged("unit")}}};$AA.MoveAnimation.registerClass("AjaxControlToolkit.Animation.MoveAnimation",$AA.ParallelAnimation);$AA.registerAnimation("move",$AA.MoveAnimation);$AA.ResizeAnimation=function(d,c,e,h,g,f){var b=null,a=this;$AA.ResizeAnimation.initializeBase(a,[d,c,e,b]);a._width=h;a._height=g;a._horizontalAnimation=new $AA.LengthAnimation(d,c,e,"style","width",b,b,f);a._verticalAnimation=new $AA.LengthAnimation(d,c,e,"style","height",b,b,f);a.add(a._horizontalAnimation);a.add(a._verticalAnimation)};$AA.ResizeAnimation.prototype={onStart:function(){var a=this;$AA.ResizeAnimation.callBaseMethod(a,"onStart");var b=a.get_target();a._horizontalAnimation.set_startValue(b.offsetWidth);a._verticalAnimation.set_startValue(b.offsetHeight);a._horizontalAnimation.set_endValue(a._width!==null&&a._width!==undefined?a._width:b.offsetWidth);a._verticalAnimation.set_endValue(a._height!==null&&a._height!==undefined?a._height:b.offsetHeight)},get_width:function(){return this._width},set_width:function(b){var a=this;b=a._getFloat(b);if(a._width!=b){a._width=b;a.raisePropertyChanged("width")}},get_height:function(){return this._height},set_height:function(b){var a=this;b=a._getFloat(b);if(a._height!=b){a._height=b;a.raisePropertyChanged("height")}},get_unit:function(){this._horizontalAnimation.get_unit()},set_unit:function(b){var a=this,c=a._horizontalAnimation.get_unit();if(c!=b){a._horizontalAnimation.set_unit(b);a._verticalAnimation.set_unit(b);a.raisePropertyChanged("unit")}}};$AA.ResizeAnimation.registerClass("AjaxControlToolkit.Animation.ResizeAnimation",$AA.ParallelAnimation);$AA.registerAnimation("resize",$AA.ResizeAnimation);$AA.ScaleAnimation=function(i,g,j,c,e,h,f,d){var b=null,a=this;$AA.ScaleAnimation.initializeBase(a,[i,g,j]);a._scaleFactor=c!==undefined?c:1;a._unit=e!==undefined?e:"px";a._center=h;a._scaleFont=f;a._fontUnit=d!==undefined?d:"pt";a._element=b;a._initialHeight=b;a._initialWidth=b;a._initialTop=b;a._initialLeft=b;a._initialFontSize=b};$AA.ScaleAnimation.prototype={getAnimatedValue:function(a){return this.interpolate(1,this._scaleFactor,a)},onStart:function(){var a=this;$AA.ScaleAnimation.callBaseMethod(a,"onStart");a._element=a.get_target();if(a._element){a._initialHeight=a._element.offsetHeight;a._initialWidth=a._element.offsetWidth;if(a._center){a._initialTop=a._element.offsetTop;a._initialLeft=a._element.offsetLeft}if(a._scaleFont)a._initialFontSize=parseFloat($common.getCurrentStyle(a._element,"fontSize"))}},setValue:function(b){var a=this;if(a._element){var e=Math.round(a._initialWidth*b),d=Math.round(a._initialHeight*b);a._element.style.width=e+a._unit;a._element.style.height=d+a._unit;if(a._center){a._element.style.top=a._initialTop+Math.round((a._initialHeight-d)/2)+a._unit;a._element.style.left=a._initialLeft+Math.round((a._initialWidth-e)/2)+a._unit}if(a._scaleFont){var c=a._initialFontSize*b;if(a._fontUnit=="px"||a._fontUnit=="pt")c=Math.round(c);a._element.style.fontSize=c+a._fontUnit}}},onEnd:function(){var b=null,a=this;a._element=b;a._initialHeight=b;a._initialWidth=b;a._initialTop=b;a._initialLeft=b;a._initialFontSize=b;$AA.ScaleAnimation.callBaseMethod(a,"onEnd")},get_scaleFactor:function(){return this._scaleFactor},set_scaleFactor:function(b){var a=this;b=a._getFloat(b);if(a._scaleFactor!=b){a._scaleFactor=b;a.raisePropertyChanged("scaleFactor")}},get_unit:function(){return this._unit},set_unit:function(a){if(this._unit!=a){this._unit=a;this.raisePropertyChanged("unit")}},get_center:function(){return this._center},set_center:function(b){var a=this;b=a._getBoolean(b);if(a._center!=b){a._center=b;a.raisePropertyChanged("center")}},get_scaleFont:function(){return this._scaleFont},set_scaleFont:function(b){var a=this;b=a._getBoolean(b);if(a._scaleFont!=b){a._scaleFont=b;a.raisePropertyChanged("scaleFont")}},get_fontUnit:function(){return this._fontUnit},set_fontUnit:function(a){if(this._fontUnit!=a){this._fontUnit=a;this.raisePropertyChanged("fontUnit")}}};$AA.ScaleAnimation.registerClass("AjaxControlToolkit.Animation.ScaleAnimation",$AA.Animation);$AA.registerAnimation("scale",$AA.ScaleAnimation);$AA.Action=function(b,a,c){$AA.Action.initializeBase(this,[b,a,c]);if(a===undefined)this.set_duration(0)};$AA.Action.prototype={onEnd:function(){this.doAction();$AA.Action.callBaseMethod(this,"onEnd")},doAction:function(){throw Error.notImplemented()},getAnimatedValue:function(){},setValue:function(){}};$AA.Action.registerClass("AjaxControlToolkit.Animation.Action",$AA.Animation);$AA.registerAnimation("action",$AA.Action);$AA.EnableAction=function(c,b,d,a){$AA.EnableAction.initializeBase(this,[c,b,d]);this._enabled=a!==undefined?a:true};$AA.EnableAction.prototype={doAction:function(){var a=this.get_target();if(a)a.disabled=!this._enabled},get_enabled:function(){return this._enabled},set_enabled:function(b){var a=this;b=a._getBoolean(b);if(a._enabled!=b){a._enabled=b;a.raisePropertyChanged("enabled")}}};$AA.EnableAction.registerClass("AjaxControlToolkit.Animation.EnableAction",$AA.Action);$AA.registerAnimation("enableAction",$AA.EnableAction);$AA.HideAction=function(c,a,d,b){$AA.HideAction.initializeBase(this,[c,a,d]);this._visible=b};$AA.HideAction.prototype={doAction:function(){var a=this.get_target();if(a)$common.setVisible(a,this._visible)},get_visible:function(){return this._visible},set_visible:function(a){if(this._visible!=a){this._visible=a;this.raisePropertyChanged("visible")}}};$AA.HideAction.registerClass("AjaxControlToolkit.Animation.HideAction",$AA.Action);$AA.registerAnimation("hideAction",$AA.HideAction);$AA.StyleAction=function(c,b,e,a,d){$AA.StyleAction.initializeBase(this,[c,b,e]);this._attribute=a;this._value=d};$AA.StyleAction.prototype={doAction:function(){var a=this.get_target();if(a)a.style[this._attribute]=this._value},get_attribute:function(){return this._attribute},set_attribute:function(a){if(this._attribute!=a){this._attribute=a;this.raisePropertyChanged("attribute")}},get_value:function(){return this._value},set_value:function(a){if(this._value!=a){this._value=a;this.raisePropertyChanged("value")}}};$AA.StyleAction.registerClass("AjaxControlToolkit.Animation.StyleAction",$AA.Action);$AA.registerAnimation("styleAction",$AA.StyleAction);$AA.OpacityAction=function(c,a,d,b){$AA.OpacityAction.initializeBase(this,[c,a,d]);this._opacity=b};$AA.OpacityAction.prototype={doAction:function(){var a=this.get_target();if(a)$common.setElementOpacity(a,this._opacity)},get_opacity:function(){return this._opacity},set_opacity:function(b){var a=this;b=a._getFloat(b);if(a._opacity!=b){a._opacity=b;a.raisePropertyChanged("opacity")}}};$AA.OpacityAction.registerClass("AjaxControlToolkit.Animation.OpacityAction",$AA.Action);$AA.registerAnimation("opacityAction",$AA.OpacityAction);$AA.ScriptAction=function(c,a,d,b){$AA.ScriptAction.initializeBase(this,[c,a,d]);this._script=b};$AA.ScriptAction.prototype={doAction:function(){try{eval(this._script)}catch(ex){}},get_script:function(){return this._script},set_script:function(a){if(this._script!=a){this._script=a;this.raisePropertyChanged("script")}}};$AA.ScriptAction.registerClass("AjaxControlToolkit.Animation.ScriptAction",$AA.Action);$AA.registerAnimation("scriptAction",$AA.ScriptAction);
//END AjaxControlToolkit.Animation.Animations.js
//START ESRI.ArcGIS.ADF.Web.UI.WebControls.Runtime.JavaScript.ESRI.ADF.Animations.release.js
//----------------------------------------------------------
// Copyright (C) ESRI. All rights reserved.
//----------------------------------------------------------
Type.registerNamespace('ESRI.ADF.Animations');ESRI.ADF.Animations.ParallelAnimation = function(target, duration, fps, animations) {
ESRI.ADF.Animations.ParallelAnimation.initializeBase(this, [target, duration, fps, animations]);}
ESRI.ADF.Animations.ParallelAnimation.prototype = {
_onTimerTick : function() {
ESRI.ADF.Animations.ParallelAnimation.callBaseMethod(this, '_onTimerTick');var handler = this.get_events().getHandler('tick');if (handler) { handler(this);}
},
add_tick : function(handler) {
this.get_events().addHandler('tick', handler);},
remove_tick : function(handler) { this.get_events().removeHandler('tick', handler);}
}
ESRI.ADF.Animations.ParallelAnimation.registerClass('ESRI.ADF.Animations.ParallelAnimation', AjaxControlToolkit.Animation.ParallelAnimation);ESRI.ADF.Animations.ZoomAnimation = function(target, duration, fps, scaleFactor, centerX, centerY) {
ESRI.ADF.Animations.ZoomAnimation.initializeBase(this, [target, duration, fps]);this._scaleFactor = (scaleFactor !== undefined) ? scaleFactor : 1;if(centerX!=null && centerX!=undefined) this._centerX = centerX;else this._centerX = parseInt(target.offsetWidth)*0.5;if(centerY!=null && centerY!=undefined) this._centerY = centerY;else this._centerY = parseInt(target.offsetHeight)*0.5;this._unit = 'px';this._element = null;this._initialHeight = null;this._initialWidth = null;this._initialTop = null;this._initialLeft = null;this._initialFontSize = null;}
ESRI.ADF.Animations.ZoomAnimation.prototype = {
getAnimatedValue : function(percentage) {
return this.interpolate(1.0, this._scaleFactor, percentage);},
onStart : function() {
ESRI.ADF.Animations.ZoomAnimation.callBaseMethod(this, 'onStart');this._element = this.get_target();if (this._element) {
this._initialHeight = parseInt(this._element.offsetHeight);this._initialWidth = parseInt(this._element.offsetWidth);this._initialTop = parseInt(this._element.offsetTop);this._initialLeft = parseInt(this._element.offsetLeft);}
},
play : function() {
ESRI.ADF.Animations.ZoomAnimation.callBaseMethod(this, 'play');this._timer.add_tick(this.raiseTick);},
setValue : function(scale) {
if (this._element) {
var width = Math.round(this._initialWidth * scale);var height = Math.round(this._initialHeight * scale);var style = this._element.style;style.width = width+1 + this._unit;style.height = height+1 + this._unit;style.left = this._centerX - Math.round((this._centerX-this._initialLeft)*scale) + this._unit;style.top = this._centerY - Math.round((this._centerY-this._initialTop)*scale) + this._unit;}
}, 
onEnd : function() {
this._element = null;this._initialHeight = null;this._initialWidth = null;this._initialTop = null;this._initialLeft = null;ESRI.ADF.Animations.ZoomAnimation.callBaseMethod(this, 'onEnd');},
get_scaleFactor : function() {
return this._scaleFactor;},
set_scaleFactor : function(value) {
this._scaleFactor = value;},
get_centerX : function() {
return this._centerX;},
set_centerX : function(value) {
this._centerX = value;},
get_centerY : function() {
return this._centerY;},
set_centerY : function(value) {
this._centerY = value;}
}
ESRI.ADF.Animations.ZoomAnimation.registerClass('ESRI.ADF.Animations.ZoomAnimation', AjaxControlToolkit.Animation.Animation);AjaxControlToolkit.Animation.registerAnimation('scale', ESRI.ADF.Animations.ZoomAnimation);
//END ESRI.ArcGIS.ADF.Web.UI.WebControls.Runtime.JavaScript.ESRI.ADF.Animations.release.js
//START ESRI.ArcGIS.ADF.Web.UI.WebControls.Runtime.JavaScript.ESRI.ADF.Geometries.release.js
//----------------------------------------------------------
// Copyright (C) ESRI. All rights reserved.
//----------------------------------------------------------
Type.registerNamespace('ESRI.ADF.Geometries');ESRI.ADF.Geometries.Geometry = function(spatialReference) {
this._spatialReference = spatialReference;};ESRI.ADF.Geometries.Geometry.prototype = { 
get_spatialReference : function() {
return this._spatialReference;},
set_spatialReference : function(value) {
if(value!=this._spatialReference) {
this._spatialReference = value;this.raisePropertyChanged('spatialReference');}
},
getEnvelope : function() {
throw(new Error.notImplemented('getEnvelope'));}
};ESRI.ADF.Geometries.Geometry.registerClass('ESRI.ADF.Geometries.Geometry');ESRI.ADF.Geometries.Point = function(x,y,spatialReference) { 
ESRI.ADF.Geometries.Point.initializeBase(this, [spatialReference]);this.coordinates = [0.0,0.0];if(x) this.coordinates[0] = x;if(y) this.coordinates[1] = y;}
ESRI.ADF.Geometries.Point.prototype = {
toString : function(separator) {
if(!separator) separator = ',';return this.coordinates[0].toString() + separator + this.coordinates[1].toString();},
equals : function(other) {
return (this.coordinates[0]==other.coordinates[0] && this.coordinates[1]==other.coordinates[1]);},
getEnvelope : function() {
return new ESRI.ADF.Geometries.Envelope(this,this);},
get_x : function() {
return this.coordinates[0];},
set_x : function(value) {
this.coordinates[0] = value;},
get_y : function() {
return this.coordinates[1];},
set_y : function(value) {
this.coordinates[1] = value;}
}
ESRI.ADF.Geometries.Point.fromString = function(value) {
var arr = value.split(',');var x = parseFloat(arr[0]);var y = parseFloat(arr[1]);return new ESRI.ADF.Geometries.Point(x,y);}
ESRI.ADF.Geometries.Point.registerClass('ESRI.ADF.Geometries.Point', ESRI.ADF.Geometries.Geometry);ESRI.ADF.Geometries.GeometryCollection = function(geomtype,spatialReference) { 
ESRI.ADF.Geometries.GeometryCollection.initializeBase(this, [spatialReference]);this._geoms = [];if(!geomtype)
this._type = ESRI.ADF.Geometries.Geometry
else
this._type = geomtype;}
ESRI.ADF.Geometries.GeometryCollection.prototype = {
isEmpty : function() {
return (this._geoms.length>0);},
get_count : function() {
return this._geoms.length;},
add : function(geom) {
if(Sys.Debug.isDebug) { var e = Function._validateParams(arguments, [ {name: geom, type: this._type} ]);if(e) { throw e;} };this._geoms[this._geoms.length] = geom;},
get : function(index) {
return this._geoms[index];},
getFirst : function() {
if(this._geoms.length==0) return null;else return this._geoms[0];},
getLast : function() {
if(this._geoms.length==0) return null;else return this._geoms[this._geoms.length-1];},
remove : function(geom) {
Array.remove(this._geoms, point);},
removeAt : function(index) {
Array.removeAt(this._geoms, index);},
insert : function(index, geom) {
if(Sys.Debug.isDebug) { var e = Function._validateParams(arguments, [ {name: point, type: this._type} ]);if(e) { throw e;} };Array.insert(this._geoms, index, point);},
clear : function() {
Array.clear(this._geoms);},
getEnvelope : function() {
var env=null;for(var idx=0;idx<this.get_count();idx++) {
if(env) env = env.join(this._geoms[idx].getEnvelope());else env = this._geoms[idx].getEnvelope();}
return env;}
}
ESRI.ADF.Geometries.GeometryCollection.registerClass('ESRI.ADF.Geometries.GeometryCollection', ESRI.ADF.Geometries.Geometry);ESRI.ADF.Geometries.CoordinateCollection = function(points,spatialReference) { 
ESRI.ADF.Geometries.CoordinateCollection.initializeBase(this, [spatialReference]);this._coords = points?points:[];}
ESRI.ADF.Geometries.CoordinateCollection.prototype = {
toString : function(pntSeperator,coordSeparator) {
var pntCount = this.get_count();if(pntCount==0) return '';if(!pntSeperator) pntSeperator = ' ';var sb = new Sys.StringBuilder();sb.append(this.get(0)[0] + coordSeparator + this.get(0)[1]);for(var idx=1;idx<pntCount;idx++) {
sb.append(pntSeperator);sb.append(this.get(idx)[0] + coordSeparator + this.get(idx)[1]);}
return sb.toString();},
getEnvelope : function() {
if(this._coords.length===0) return null;var minx=this._coords[0][0];var miny=this._coords[0][1];var maxx=minx;var maxy=miny;for(var idx=1;idx<this.get_count();idx++) {
var g = this._coords[idx]
minx=Math.min(minx,g[0]);miny=Math.min(miny,g[1]);maxx=Math.max(maxx,g[0]);maxy=Math.max(maxy,g[1]);}
return new ESRI.ADF.Geometries.Envelope(minx,miny,maxx,maxy);},
get : function(index) {
return this._coords[index];},
getAsPoint : function(index) {
return new ESRI.ADF.Geometries.Point(this._coords[index][0],this._coords[index][1]);},
add : function(coord) {
this._coords[this._coords.length] = coord;},
get_coordinates: function() {
return this._coords;},
set_coordinates : function(value){
this._coords = value;},
getFirst : function() {
if(this._coords.length==0) return null;else return this._coords[0];},
getLast : function() {
if(this._coords.length==0) return null;else return this._coords[this._coords.length-1];}, 
removeAt : function(index) {
Array.removeAt(this._coords, index);},
get_count : function() {
return this._coords.length;},
clear : function() {
this._coords = [];} 
}
ESRI.ADF.Geometries.CoordinateCollection.fromString = function(value) {
var pnts = new ESRI.ADF.Geometries.CoordinateCollection();if(!value) { return pnts;}
var arr = value.split(' ');var geoms = [];for(var k=0;k<arr.length;k++) {
if(arr[k]) {
Array.add(geoms, ESRI.ADF.Geometries.Point.fromString(arr[k]).coordinates);}
}
pnts._coords = geoms;return pnts;}
ESRI.ADF.Geometries.CoordinateCollection.registerClass('ESRI.ADF.Geometries.CoordinateCollection',ESRI.ADF.Geometries.Geometry);ESRI.ADF.Geometries.Polyline = function(path, spatialReference) { 
ESRI.ADF.Geometries.Polyline.initializeBase(this, [spatialReference]);this._paths = new ESRI.ADF.Geometries.GeometryCollection(ESRI.ADF.Geometries.CoordinateCollection, spatialReference);if(path) this._paths.add(path);}
ESRI.ADF.Geometries.Polyline.prototype = { 
addPath : function(path) {
this._paths.add(path);},
getPath : function(n) {
return this._paths.get(n);},
getPathCount : function() {
return this._paths.get_count();},
getEnvelope : function() {
return this._paths.getEnvelope();}
}
ESRI.ADF.Geometries.Polyline.registerClass('ESRI.ADF.Geometries.Polyline', ESRI.ADF.Geometries.Geometry);ESRI.ADF.Geometries.Surface = function(spatialReference) { 
ESRI.ADF.Geometries.Surface.initializeBase(this, [spatialReference]);}
ESRI.ADF.Geometries.Surface.prototype = {
get_area : function() {
throw(new Error.notImplemented('get_area'));}
}
ESRI.ADF.Geometries.Surface.registerClass('ESRI.ADF.Geometries.Surface', ESRI.ADF.Geometries.Geometry);ESRI.ADF.Geometries.Polygon = function(ring, spatialReference) { 
ESRI.ADF.Geometries.Polygon.initializeBase(this, [spatialReference]);this._rings = new ESRI.ADF.Geometries.GeometryCollection(ESRI.ADF.Geometries.CoordinateCollection, spatialReference);if(ring) this._rings.add(ring);}
ESRI.ADF.Geometries.Polygon.prototype = {
addRing : function(ring) {
this._rings.add(ring);},
getRing : function(n) {
return this._rings.get(n);},
getRingCount : function() {
return this._rings.get_count();},
getEnvelope : function() {
return this._rings.getEnvelope();}
}
ESRI.ADF.Geometries.Polygon.registerClass('ESRI.ADF.Geometries.Polygon', ESRI.ADF.Geometries.Surface);ESRI.ADF.Geometries.Oval = function(center, width, height, spatialReference) { 
ESRI.ADF.Geometries.Oval.initializeBase(this, [spatialReference]);this._center = center;this._width = width;this._height = (height==null || height==undefined)?width:height;}
ESRI.ADF.Geometries.Oval.prototype = {
getEnvelope : function() {
return new ESRI.ADF.Geometries.Envelope(
this._center.get_x()-Math.abs(this._width)*0.5, this._center.get_y()-Math.abs(this._height)*0.5,
this._center.get_x()+Math.abs(this._width)*0.5, this._center.get_y()+Math.abs(this._height)*0.5,
this._spatialReference);},
get_area : function() {
return Math.PI * Math.abs(this._width) * Math.abs(this._height);},
toString : function() {
return this.getEnvelope().toString();},
get_center : function() {
return this._center;},
set_center : function(value) { this._center = value;},
get_width : function() {
return this._width;},
set_width : function(value) { this._width = value;},
get_height : function() {
return this._height;},
set_height : function(value) { this._height = value;}
}
ESRI.ADF.Geometries.Oval.registerClass('ESRI.ADF.Geometries.Oval', ESRI.ADF.Geometries.Surface);ESRI.ADF.Geometries.Envelope = function() { 
var n = arguments.length;var spatialReference = null;if(n>2 && String.isInstanceOfType(arguments[n-1])) {
spatialReference = arguments[n-1];}
else if(n<2) throw new Error.argument('ESRI.ADF.Geometries.Envelope','Invalid number of arguments');if(ESRI.ADF.Geometries.Point.isInstanceOfType(arguments[0]) && ESRI.ADF.Geometries.Point.isInstanceOfType(arguments[1])) {
this._xmin = Math.min(arguments[0].get_x(),arguments[1].get_x());this._ymin = Math.min(arguments[0].get_y(),arguments[1].get_y());this._xmax = Math.max(arguments[0].get_x(),arguments[1].get_x());this._ymax = Math.max(arguments[0].get_y(),arguments[1].get_y());}
else if(n>=4 && Number.isInstanceOfType(arguments[0]) && Number.isInstanceOfType(arguments[1]) && 
Number.isInstanceOfType(arguments[2]) && Number.isInstanceOfType(arguments[3])) {
this._xmin = Math.min(arguments[0],arguments[2]);this._ymin = Math.min(arguments[1],arguments[3]);this._xmax = Math.max(arguments[0],arguments[2]);this._ymax = Math.max(arguments[1],arguments[3]);}
else throw new Error.argument('ESRI.ADF.Geometries.Envelope','Invalid arguments');ESRI.ADF.Geometries.Envelope.initializeBase(this, [spatialReference]);}
ESRI.ADF.Geometries.Envelope.prototype = {
get_area : function() {
return (this.get_width()*this.get_height());},
toString : function() {
return '[' + this._xmin+','+this._ymin + ' ' +this._xmax+','+this._ymax + ']';},
get_xmin : function() {
return this._xmin;},
set_xmin : function(value) {
this._xmin = value;},
get_ymin : function() {
return this._ymin;},
set_ymin : function(value) {
this._ymin = value;},
get_xmax : function() {
return this._xmax;},
set_xmax : function(value) {
this._xmax = value;},
get_ymax : function() {
return this._ymax;},
set_ymax : function(value) {
this._ymax = value;}, 
intersects : function(env2) {
if(!env2) return false;return !(env2._xmin > this._xmax ||
env2._xmax < this._xmin ||
env2._ymin > this._ymax ||
env2._ymax < this._ymin);},
join : function(env2) {
if(!env2) return this;return new ESRI.ADF.Geometries.Envelope(
new ESRI.ADF.Geometries.Point(
(this._xmin<env2._xmin?this._xmin:env2._xmin),
(this._ymin<env2._ymin?this._ymin:env2._ymin)),
new ESRI.ADF.Geometries.Point(
(this._xmax>env2._xmax?this._xmax:env2._xmax),
(this._ymax>env2._ymax?this._ymax:env2._ymax)),
this._spatialReference);},
get_width : function() {
return (this._xmax-this._xmin);},
get_height : function() {
return (this._ymax-this._ymin);},
get_center : function() {
return new ESRI.ADF.Geometries.Point(
(this._xmin+this._xmax)*0.5,
(this._ymin+this._ymax)*0.5, this._spatialReference);},
intersection : function(env2) {
if(!this.intersects(env2)) return null;return new ESRI.ADF.Geometries.Envelope(
new ESRI.ADF.Geometries.Point(
(this._xmin>env2._xmin?this._xmin:env2._xmin),
(this._ymin>env2._ymin?this._ymin:env2._ymin)),
new ESRI.ADF.Geometries.Point(
(this._xmax<env2._xmax?this._xmax:env2._xmax),
(this._ymax<env2._ymax?this._ymax:env2._ymax)),
this._spatialReference);},
getEnvelope : function() {
return this.clone();},
clone: function() {
return new ESRI.ADF.Geometries.Envelope(this._xmin,this._ymin,this._xmax,this._ymax);}
}
ESRI.ADF.Geometries.Envelope.registerClass('ESRI.ADF.Geometries.Envelope', ESRI.ADF.Geometries.Surface);if (typeof(Sys) !== "undefined") Sys.Application.notifyScriptLoaded();
//END ESRI.ArcGIS.ADF.Web.UI.WebControls.Runtime.JavaScript.ESRI.ADF.Geometries.release.js
//START ESRI.ArcGIS.ADF.Web.UI.WebControls.Runtime.JavaScript.ESRI.ADF.Graphics.release.js
//----------------------------------------------------------
// Copyright (C) ESRI. All rights reserved.
//----------------------------------------------------------
Type.registerNamespace('ESRI.ADF.Graphics');ESRI.ADF.Graphics.Symbol = function(cursor) {
this._cursor = (cursor?cursor:null);this._opacity = 1.0;};ESRI.ADF.Graphics.Symbol.prototype = {
clone: function() {
throw(new Error.notImplemented('clone'));},
get_cursor : function() {
return this._cursor;},
set_cursor : function(value) { this._cursor = value;},
get_opacity : function() {
return this._opacity;},
set_opacity : function(value) { this._opacity = value;}
};ESRI.ADF.Graphics.Symbol.registerClass('ESRI.ADF.Graphics.Symbol');ESRI.ADF.Graphics.MarkerSymbol = function(imageUrl,centerX,centerY,cursor) {
ESRI.ADF.Graphics.MarkerSymbol.initializeBase(this,[cursor]);this._imageUrl = imageUrl;this._centerX = (centerX?centerX:0);this._centerY = (centerY?centerY:0);this._clipX = this._clipY = this._width = this._height = null;this._imageFormat = null;};ESRI.ADF.Graphics.MarkerSymbol.prototype = { 
clone : function() {
var symb = new ESRI.ADF.Graphics.MarkerSymbol(this._imageUrl,this._centerX,this._centerY,this._cursor);symb.set_clipX(this._clipX);symb.set_clipY(this._clipY);symb.set_width(this._width);symb.set_height(this._height);symb.set_opacity(this._opacity);symb.set_imageFormat(this._imageFormat);return symb;},
get_imageUrl : function() {
return this._imageUrl;},
set_imageUrl : function(value) { this._imageUrl = value;},
get_imageFormat : function() {
return this._imageFormat;},
set_imageFormat : function(value) { this._imageFormat = value;},
get_centerX : function() {
return this._centerX;},
set_centerX : function(value) { this._centerX = value;},
get_centerY : function() {
return this._centerY;},
set_centerY : function(value) { this._centerY = value;},
get_width : function() {
return this._width;},
set_width : function(value) { this._width = value;},
get_height : function() {
return this._height;},
set_height : function(value) { this._height = value;},
get_clipX : function() {
return this._clipX;},
set_clipX : function(value) { this._clipX = value;},
get_clipY : function() {
return this._clipY;},
set_clipY : function(value) { this._clipY = value;}
};ESRI.ADF.Graphics.MarkerSymbol.registerClass('ESRI.ADF.Graphics.MarkerSymbol', ESRI.ADF.Graphics.Symbol);ESRI.ADF.Graphics.CapType = function() {
throw Error.invalidOperation();};ESRI.ADF.Graphics.CapType.prototype = {
Round : 0,
Flat: 1,
Square : 2
};ESRI.ADF.Graphics.CapType.registerEnum("ESRI.ADF.Graphics.CapType", false);ESRI.ADF.Graphics.JoinType = function() {
throw Error.invalidOperation();};ESRI.ADF.Graphics.JoinType.prototype = {
Round : 0,
Bevel: 1,
Miter : 2
};ESRI.ADF.Graphics.JoinType.registerEnum("ESRI.ADF.Graphics.JoinType", false);ESRI.ADF.Graphics.LineSymbol = function(lineColor,width,cursor) {
ESRI.ADF.Graphics.LineSymbol.initializeBase(this, [cursor]);this._dashPattern = null;this._capType = ESRI.ADF.Graphics.CapType.Round;this._joinType = ESRI.ADF.Graphics.JoinType.Round;this.set_lineColor(lineColor?lineColor:'#000000');this._width = (width?width:1.0);};ESRI.ADF.Graphics.LineSymbol.prototype = { 
clone : function() {
var cloneObj = new ESRI.ADF.Graphics.LineSymbol(this._lineColor,this.get_width(),this.get_cursor());cloneObj.set_dashPattern(this.get_dashPattern());cloneObj.set_capType(this.get_capType());cloneObj.set_joinType(this.get_joinType());cloneObj.set_opacity(this.get_opacity());return cloneObj;},
get_dashPattern : function() {
return this._dashPattern;},
set_dashPattern : function(value) { this._dashPattern = value;},
get_capType : function() {
return this._capType;},
set_capType : function(value) { this._capType = value;},
get_joinType : function() {
return this._joinType;},
set_joinType : function(value) { this._joinType = value;},
get_lineColor : function() {
return this._lineColor;},
set_lineColor : function(value) { this._lineColor = value;},
get_width : function() {
return this._width;},
set_width : function(value) { this._width = value;}
};ESRI.ADF.Graphics.LineSymbol.registerClass('ESRI.ADF.Graphics.LineSymbol', ESRI.ADF.Graphics.Symbol);ESRI.ADF.Graphics.FillSymbol = function(color,outlineColor,outlineWidth,cursor) {
ESRI.ADF.Graphics.FillSymbol.initializeBase(this, [cursor]);this._fillColor = color;if(outlineColor) { this._outline = new ESRI.ADF.Graphics.LineSymbol(outlineColor,outlineWidth);}
else {this._outline = null;}
};ESRI.ADF.Graphics.FillSymbol.prototype = {
clone : function() {
var cloneObj = new ESRI.ADF.Graphics.FillSymbol(this._fillColor);cloneObj.set_opacity(this.get_opacity());cloneObj.set_cursor(this.get_cursor());var outline = this.get_outline();if(outline) { cloneObj.set_outline(outline.clone());}
else { cloneObj.set_outline(null);}
return cloneObj;},
get_fillColor : function() {
return this._fillColor;},
set_fillColor : function(value) { this._fillColor = value;},
get_outline : function() {
return this._outline;},
set_outline : function(value) { this._outline = value;} 
};ESRI.ADF.Graphics.FillSymbol.registerClass('ESRI.ADF.Graphics.FillSymbol', ESRI.ADF.Graphics.Symbol);ESRI.ADF.Graphics.GraphicFeatureBase = function(symbol) {
ESRI.ADF.Graphics.GraphicFeatureBase.initializeBase(this);this._opacity = 1.0;this._symbol = (symbol?symbol:null);this._selectedSymbol = null;this._highlightSymbol = null;};ESRI.ADF.Graphics.GraphicFeatureBase.prototype = {
get_mapTips : function() {
return this._mapTips;},
set_mapTips : function(value) {
if(this._mapTips!==value) {
if(this._mapTips) { this._mapTips.removeGraphics(this);}
this._mapTips = value;if(this._mapTips) {
this._mapTips.addGraphics(this);if(!this._mapTips.get_isInitialized() && this._map) { this._mapTips.initialize();}
}
this.raisePropertyChanged('mapTips');}
},
__set_map : function(value) {
if(this._map!==null && value!==null && this._map !== value) {
throw new Error.invalidOperation('Cannot add graphic to multiple map instances');}
this._map = value;if(this._map===null) { this._mapTips = null;}
else {
if(this._mapTips && !this._mapTips._map) {
this._mapTips.__set_map(this._map);}
}
},
__get_canvas : function(canvas) {
throw Error.notImplemented('__get_canvas');},
get_symbol : function() {
return this._symbol;},
set_symbol : function(value) {
if(this._symbol !== value) {
this._symbol = value;this.raisePropertyChanged('symbol');}
},
get_selectedSymbol : function() {
return this._selectedSymbol;},
set_selectedSymbol : function(value) { 
if(this._selectedSymbol !== value) {
this._selectedSymbol = value;this.raisePropertyChanged('selectedSymbol');}
},
get_highlightSymbol : function() {
return this._highlightSymbol;},
set_highlightSymbol : function(value) { 
if(this._highlightSymbol !== value) {
this._highlightSymbol = value;}
},
add_click : function(handler) {
this.get_events().addHandler('click', handler);},
remove_click : function(handler) { this.get_events().removeHandler('click', handler);},
add_mouseMove : function(handler) {
this.get_events().addHandler('mouseMove', handler);},
remove_mouseMove : function(handler) { this.get_events().removeHandler('mouseMove', handler);},
add_mouseOver : function(handler) {
this.get_events().addHandler('mouseOver', handler);},
remove_mouseOver : function(handler) { this.get_events().removeHandler('mouseOver', handler);},
add_mouseOut : function(handler) {
this.get_events().addHandler('mouseOut', handler);},
remove_mouseOut : function(handler) { this.get_events().removeHandler('mouseOut', handler);},
_raiseEvent : function(name,e) {
var handler = this.get_events().getHandler(name);if (handler) { if(!e) { e = Sys.EventArgs.Empty;} handler(this, e);}
}
};ESRI.ADF.Graphics.GraphicFeatureBase.registerClass('ESRI.ADF.Graphics.GraphicFeatureBase', Sys.Component);ESRI.ADF.Graphics.GraphicFeature = function(geometry,symbol,attributes) {
ESRI.ADF.Graphics.GraphicFeature.initializeBase(this,[symbol]);this._geometry = geometry;this._displayOnToc = false;this._envelope = null;this._graphicReference = null;this._canvas = null;this._attributes = null;this._isSelected = false;this._attributes = attributes;this._mapTips = null;this._map = null;this._onClickHandler = Function.createDelegate(this,function(e){ e.element = this;this._raiseEvent('click',e);});this._onMoveHandler = Function.createDelegate(this,function(e){e.element = this;this._raiseEvent('mouseMove',e);});this._onOverHandler = Function.createDelegate(this,function(e){e.element = this;this._raiseEvent('mouseOver',e);});this._onOutHandler = Function.createDelegate(this,function(e){e.element = this;this._raiseEvent('mouseOut',e);});this._propChangedHandler = Function.createDelegate(this,this._propertyChanged);this._highlight = false;};ESRI.ADF.Graphics.GraphicFeature.prototype = {
initialize : function() {
ESRI.ADF.Graphics.GraphicFeature.callBaseMethod(this, 'initialize');this.add_propertyChanged(this._propChangedHandler);},
dispose : function() {
this._envelope = null;this.clearGraphicReference();if(this._propChangedHandler) { this.remove_propertyChanged(this._propChangedHandler);}
ESRI.ADF.Graphics.GraphicFeature.callBaseMethod(this, 'dispose');this._onClickHandler = null;this._onMoveHandler = null;this._onOverHandler = null;this._onOutHandler = null;this._propChangedHandler = null;},
_propertyChanged : function(sender, eventArgs) {
if(eventArgs.get_propertyName() === 'geometry') { this._envelope=null;}
},
getEnvelope : function() {
if(!this._envelope && this._geometry) { this._setEnvelope();}
return this._envelope;},
_setEnvelope : function() {
if(this._geometry && this._geometry.getEnvelope) {
this._envelope = this._geometry.getEnvelope();}
else { this._envelope = null;}
},
get_graphicReference : function(element) {
return this._graphicReference;},
set_graphicReference : function(element) {
if(element===this._graphicReference) { return;}
this.clearGraphicReference();this._graphicReference = element;if(this._graphicReference) {
this._hookEvents();this._applyZIndex();}
this.raisePropertyChanged('graphicReference');},
clearGraphicReference : function() {
if(this._graphicReference) {
if(Array.isInstanceOfType(this._graphicReference)) {
for(var idx=0;idx<this._graphicReference.length;idx++) {
this._clearGraphicReferenceElement(this._graphicReference[idx]);this._graphicReference[idx]=null;}
}
else { this._clearGraphicReferenceElement(this._graphicReference);}
this._graphicReference = null;}
},
_clearGraphicReferenceElement : function(element) {
if(element) {
$clearHandlers(element);if(element.parentNode) { element.parentNode.removeChild(element);}
}
},
_hookEvents : function() {
if(Array.isInstanceOfType(this._graphicReference)) {
for(var idx=0;idx<this._graphicReference.length;idx++) {
this._hookElementEvent(this._graphicReference[idx]);}
}
else { this._hookElementEvent(this._graphicReference);}
},
_hookElementEvent : function(element) {
$addHandler(element,'mousemove',this._onMoveHandler);$addHandler(element,'mouseover',this._onOverHandler);$addHandler(element,'mouseout',this._onOutHandler);$addHandler(element,'click',this._onClickHandler);},
__set_groupParent : function(parent) {
this._parent = parent;},
__get_canvas : function(canvas) {
if(this._map) { return this._map._assotateCanvas;}
if(this._parent) { return this._parent.__get_canvas();}
return null;},
__draw : function(updateSymbolOnly) {
var symb = this._getActiveSymbol();if(!symb) {
if(this._graphicReference) { 
if(Array.isInstanceOfType(this._graphicReference)) {
for(var idx=0;idx<this._graphicReference.length;idx++) {
this._graphicReference[idx].parentNode.removeChild(this._graphicReference[idx]);this._graphicReference[idx] == null;}
}
else if(this._graphicReference.parentNode) {
this._graphicReference.parentNode.removeChild(this._graphicReference);}
this._graphicReference = null;}
return;}
if(ESRI.ADF.Geometries.Point.isInstanceOfType(this._geometry) && !ESRI.ADF.Graphics.MarkerSymbol.isInstanceOfType(symb)) {
throw(new Error.argumentType('symbol', Object.getType(symb), ESRI.ADF.Graphics.MarkerSymbol, 'Invalid symbol type "' + Object.getType(symb).getName()+ '" for rendering geometry of type "'+ Object.getType(this._geometry).getName() + '"'));}
var canvas = this.__get_canvas();if(!canvas) { return null;}
if(this._graphicReference) {
canvas.updateGeometry(this._geometry,symb,this._graphicReference,updateSymbolOnly);this._applyZIndex();return false;}
else {
this._graphicReference = canvas.drawGeometry(this._geometry,symb);this._applyZIndex();return true;}
},
_getActiveSymbol : function() {
var symb = null;if(this._highlight) { symb = (this._highlightSymbol?this._highlightSymbol : (this._parent ? this._parent.get_highlightSymbol() : symb));}
if(!symb && this._isSelected) { symb = (this._selectedSymbol?this._selectedSymbol : (this._parent ? this._parent.get_selectedSymbol() : symb));}
if(!symb) { symb = (this._symbol?this._symbol : (this._parent ? this._parent.get_symbol() : null));}
if(!symb) { return null;}
if(this._parent) {
var opacity = this._parent.get_opacity();if(opacity<1) {
symb = symb.clone();symb.set_opacity(symb.get_opacity()*opacity);}
}
return symb;},
_setSelected : function() {
if(this._graphicReference) { this.__draw(true);}
},
get_highlight: function() {
return this._highlight;},
set_highlight : function(value) {
if(this._highlight !== value) {
this._highlight = value;if(this._graphicReference) { this.__draw(true);}
}
},
_applyZIndex : function() {
var z = (ESRI.ADF.Geometries.Surface.isInstanceOfType(this._geometry) ? 0:
(ESRI.ADF.Geometries.Polyline.isInstanceOfType(this._geometry)?2:4)) + (this._highlight?1:0);if(Array.isInstanceOfType(this._graphicReference)) {
for(var idx=0;idx<this._graphicReference.length;idx++) {
this._applyZIndexElement(z,this._graphicReference[idx]);}
}
else { this._applyZIndexElement(z,this._graphicReference);} 
},
_applyZIndexElement : function(z,e) {
if(e && e.style) {
if(z) { e.style.zIndex = z;}
else { e.style.zIndex = '';}
}
},
get_isSelected : function() {
return this._isSelected;},
set_isSelected : function(value) {
if(this._isSelected!==value) {
this._isSelected = value;this.raisePropertyChanged('isSelected');this._setSelected();}
},
get_geometry : function() {
return this._geometry;},
set_geometry : function(value) {
if(this._geometry!==value) {
this._geometry = value;this.raisePropertyChanged('geometry');}
},
get_attributes : function() {
return this._attributes;},
set_attributes : function(value) {
if(this._attributes!==value) {
this._attributes = value;this.raisePropertyChanged('attributes');}
}
};ESRI.ADF.Graphics.GraphicFeature.registerClass('ESRI.ADF.Graphics.GraphicFeature', ESRI.ADF.Graphics.GraphicFeatureBase);ESRI.ADF.Graphics.GraphicFeatureGroup = function(id,defaultSymbol) {
this._id = id;ESRI.ADF.Graphics.GraphicFeatureGroup.initializeBase(this);this._elements = [];this._symbol = (defaultSymbol?defaultSymbol:null);this._transformFunc = null;this._elementChangedHandler = Function.createDelegate(this,this._onElementChanged);this._map = null;this._mapTips = null;this._visible = true;this._onClickHandler = Function.createDelegate(this,function(s,e){ this._raiseEvent('click',e);});this._onMoveHandler = Function.createDelegate(this,function(s,e){ this._raiseEvent('mouseMove',e);});this._onOverHandler = Function.createDelegate(this,function(s,e){ this._raiseEvent('mouseOver',e);});this._onOutHandler = Function.createDelegate(this,function(s,e){ this._raiseEvent('mouseOut',e);});};ESRI.ADF.Graphics.GraphicFeatureGroup.prototype = {
dispose : function() {
this.clear();ESRI.ADF.Graphics.GraphicFeatureGroup.callBaseMethod(this, 'dispose');this._onClickHandler = null;this._onMoveHandler = null;this._onOverHandler = null;this._onOutHandler = null;},
get : function(index) {
return this._elements[index];},
indexOf : function(element) {
return Array.indexOf(this._elements,element);},
add : function(element) {
this.insert(element,this._elements.length);element.__set_groupParent(this);},
insert : function(element,index) {
Array.insert(this._elements,index,element);element.__set_groupParent(this);element.add_propertyChanged(this._elementChangedHandler);this._hookEvents(element);var handler = this.get_events().getHandler('elementAdded');if (handler) { handler(this, element);}
},
getFeatureCount : function() {
return this._elements.length;},
remove : function(element) {
Array.remove(this._elements,element);element.__set_groupParent(null);element.remove_propertyChanged(this._elementChangedHandler);this._unhookEvents(element);element.clearGraphicReference();var handler = this.get_events().getHandler('elementRemoved');if (handler) { handler(this, element);}
},
clearGraphicReference : function() {
for(var idx=0;idx<this._elements.length;idx++) {
this._elements[idx].clearGraphicReference();}
},
clear : function() {
for(var idx=0;idx<this._elements.length;idx++) {
this._elements[idx].dispose();this._elements[idx] = null;}
Array.clear(this._elements);},
__get_canvas : function(canvas) {
if(this._map) { return this._map._assotateCanvas;}
else { return null;}
},
_onElementChanged : function(sender,eventArgs) {
var prop = eventArgs.get_propertyName();if(prop==='geometry' || prop==='symbol') {
var handler = this.get_events().getHandler('elementChanged');if (handler) { handler(this, sender);}
}
},
_hookEvents : function(gfxElm) {
gfxElm.add_click(this._onClickHandler);gfxElm.add_mouseMove(this._onMoveHandler);gfxElm.add_mouseOver(this._onOverHandler);gfxElm.add_mouseOut(this._onOutHandler);},
_unhookEvents : function(element) {
element.remove_click(this._onClickHandler);element.remove_mouseMove(this._onMoveHandler);element.remove_mouseOver(this._onOverHandler);element.remove_mouseOut(this._onOutHandler);},
get_opacity : function() {
return this._opacity;},
set_opacity : function(value) { this._opacity = value;},
get_visible : function() {
return this._visible;},
set_visible : function(value) { 
if(this._visible !== value) { 
this._visible = value;this._setVisible(this._elements,value);this.raisePropertyChanged('visible');}
},
_setVisible : function(features,visible) {
for(var idx=0;idx<features.length;idx++) {
if(ESRI.ADF.Graphics.GraphicFeatureGroup.isInstanceOfType(features[idx])) {
for(var j=0;j<features[idx]._elements.length();j++) {
this._setVisible(features.features[idx]._elements[j],visible);}
}
var ref = features[idx].get_graphicReference();if(ref) {
if(Array.isInstanceOfType(ref)) {
for(var k=0;k<ref.length;k++) {
ref[k].style.display = (visible?'':'none');}
}
else { ref.style.display = (visible?'':'none');}
}
}
},
add_elementChanged : function(handler) {
this.get_events().addHandler('elementChanged', handler);},
remove_elementChanged : function(handler) { this.get_events().removeHandler('elementChanged', handler);},
add_elementAdded : function(handler) {
this.get_events().addHandler('elementAdded', handler);},
remove_elementAdded : function(handler) { this.get_events().removeHandler('elementAdded', handler);},
add_elementRemoved : function(handler) {
this.get_events().addHandler('elementRemoved', handler);},
remove_elementRemoved : function(handler) { this.get_events().removeHandler('elementRemoved', handler);}
};ESRI.ADF.Graphics.GraphicFeatureGroup.registerClass('ESRI.ADF.Graphics.GraphicFeatureGroup',ESRI.ADF.Graphics.GraphicFeatureBase);ESRI.ADF.Graphics.__Canvas = function(element,transFunc) {
ESRI.ADF.Graphics.__Canvas.initializeBase(this, [element]);this._element = element;this._disposed = false;this._transFunc = transFunc;};ESRI.ADF.Graphics.createCanvas = function(element,transFunc) {
if(Sys.Browser.agent === Sys.Browser.InternetExplorer) {
return new ESRI.ADF.Graphics.__VmlCanvas(element,transFunc);}
else {
return new ESRI.ADF.Graphics.__SvgCanvas(element,transFunc);}
};ESRI.ADF.Graphics.__Canvas.prototype = {
dispose : function() {
if(this._disposed) { return;}
this.clear();ESRI.ADF.Graphics.__Canvas.callBaseMethod(this, 'dispose');this._disposed = true;},
clear : function() {
throw(new Error.notImplemented('clear'));},
updateGeometry : function(geom,symbol,element,symbolOnly) {
if(!element) { return;}
if(geom && ESRI.ADF.Geometries.GeometryCollection.isInstanceOfType(geom)) { 
for(var idx=0;idx<geom.get_count();idx++) {
this.updateGeometry(geom.get(idx),symbol,element[idx],symbolOnly);}
}
else {
if(symbol) { this.setSymbol(element,symbol);}
if((symbolOnly!==true || ESRI.ADF.Geometries.Point.isInstanceOfType(geom)) && this._transFunc) {
this.setVertices(element,this._createPntArray(geom,this._transFunc,symbol),symbol);}
}
},
drawGeometry : function(geom,symbol) {
if(ESRI.ADF.Geometries.GeometryCollection.isInstanceOfType(geom)) { 
var refs = [];for(var idx=0;idx<geom.get_count();idx++) {
Array.add(refs,this.drawGeometry(geom.get(idx),symbol));}
return refs;}
var array = this._createPntArray(geom,this._transFunc,symbol);if(ESRI.ADF.Geometries.Polygon.isInstanceOfType(geom)) {
if(array.length<6) { return null;}
return this._drawPolygon(array,symbol);}
else if(ESRI.ADF.Geometries.Envelope.isInstanceOfType(geom)) {
return this._drawEnvelope(array,symbol);}
else if(ESRI.ADF.Geometries.Polyline.isInstanceOfType(geom)) {
if(array.length<4) { return null;}
return this._drawPolyline(array,symbol);}
else if(ESRI.ADF.Geometries.Point.isInstanceOfType(geom)) { 
return this._drawPoint(array,symbol);}
else if(ESRI.ADF.Geometries.Oval.isInstanceOfType(geom)) { 
return this._drawOval(array,symbol);}
else { throw(new Error.notSupported('type not supported for clientside vector graphics rendering'));}
},
_drawPoint : function(pnt, marker) { 
var shape = this.createPoint(pnt,marker);this.setSymbol(shape,marker);this.addToCanvas(shape);return shape;},
_drawEnvelope : function(pntArray, fill) {
var shape = this.createEnvelope(pntArray);this.setSymbol(shape,fill);this.addToCanvas(shape);return shape;},
_drawPolygon : function(pntArray, fill) {
var shape = this.createPolygon(pntArray);this.setSymbol(shape,fill);this.addToCanvas(shape);return shape;},
_drawPolyline : function(pntArray, stroke) {
if(pntArray.length<2) { return null;}
var line = this.createPolyline(pntArray);this.setSymbol(line,stroke);this.addToCanvas(line);return line;},
_drawOval : function(pntArray, fill) {
var shape = this.createOval(pntArray);this.setSymbol(shape,fill);this.addToCanvas(shape);return shape;},
createPoint : function(pnt, symbol) {
var div = document.createElement('div');var img = document.createElement('img');div.appendChild(img);div.style.position = 'absolute';this.setVertices(div,pnt,symbol);return div;},
_createPntArray : function(geom,transformFunc,symbol){
var tol = 2;if(ESRI.ADF.Geometries.Polygon.isInstanceOfType(geom)) {
var parray = [];var length = geom.getRingCount();for(var j=0;j<length;j++) {
var ring = geom.getRing(j);var pntCount = ring.get_count();for(var idx=0;idx<pntCount;idx++) {
var obj = transformFunc(ring.get(idx));if(parray.length<2 || Math.abs(parray[parray.length-2]-obj.offsetX)>tol ||
Math.abs(parray[parray.length-1]-obj.offsetY)>tol || idx===pntCount-1) { 
Array.add(parray, obj.offsetX);Array.add(parray, obj.offsetY);}
}
if(j<length-1) { Array.add(parray,null);}
}
return parray;}
else if(ESRI.ADF.Geometries.Polyline.isInstanceOfType(geom)) { 
var larray = [];var pathCount = geom.getPathCount();for(var k=0;k<pathCount;k++) {
var path = geom.getPath(k);var pCount = path.get_count();for(var l=0;l<pCount;l++) {
var lobj = transformFunc(path.get(l));if(larray.length<2 || Math.abs(larray[larray.length-2]-lobj.offsetX)>tol ||
Math.abs(larray[larray.length-1]-lobj.offsetY)>tol || l===pCount-1) { 
Array.add(larray, lobj.offsetX);Array.add(larray, lobj.offsetY);}
}
if(k<pathCount-1) { Array.add(larray,null);}
}
return larray;} 
else if(ESRI.ADF.Geometries.Point.isInstanceOfType(geom)) { 
var pobj = transformFunc(geom);return [pobj.offsetX, pobj.offsetY];}
else if(ESRI.ADF.Geometries.Oval.isInstanceOfType(geom)) {
var center = transformFunc(geom.get_center());var size = transformFunc(new ESRI.ADF.Geometries.Point(geom.get_center().get_x()+geom.get_width()*0.5,geom.get_center().get_y()-geom.get_height()*0.5));return [center.offsetX,center.offsetY,Math.abs(size.offsetX-center.offsetX),Math.abs(size.offsetY-center.offsetY)];}
else if(ESRI.ADF.Geometries.Envelope.isInstanceOfType(geom)) {
var ll = transformFunc(new ESRI.ADF.Geometries.Point(geom.get_xmin(),geom.get_ymin()));var ur = transformFunc(new ESRI.ADF.Geometries.Point(geom.get_xmax(),geom.get_ymax()));return [ll.offsetX,ll.offsetY,ur.offsetX,ur.offsetY];}
else if(ESRI.ADF.Geometries.GeometryCollection.isInstanceOfType(geom)) {
Error.argumentType(Object.getTypeName(geom) + ' not yet supported');}
else { throw Error.argumentType('geom', Object.getType(geom), ESRI.ADF.Geometries.Geometry);}
}
};ESRI.ADF.Graphics.__Canvas.registerClass('ESRI.ADF.Graphics.__Canvas', Sys.UI.Control);ESRI.ADF.Graphics.__SvgCanvas = function(element,transfunc) {
ESRI.ADF.Graphics.__SvgCanvas.initializeBase(this, [element,transfunc]);};ESRI.ADF.Graphics.__SvgCanvas.prototype = {
initialize : function() {
ESRI.ADF.Graphics.__SvgCanvas.callBaseMethod(this, 'initialize');this.namespace = 'http://www.w3.org/2000/svg';this._element.style.MozUserSelect = 'none';this._element.style.zIndex = '100';this._element.parentNode.style.zIndex = '0';this._svgRoot = this._element.ownerDocument.createElementNS(this.namespace, 'svg');this._svgRoot.style.position = 'relative';this._svgRoot.style.width = '100%';this._svgRoot.style.height = '100%';this._element.appendChild(this._svgRoot);this._groupRoot = this._svgRoot.ownerDocument.createElementNS(this.namespace, 'g');this._svgRoot.appendChild(this._groupRoot);},
adjustCanvasExtent : function(left,top,height,width) {
this._svgRoot.style.left = -left + 'px';this._svgRoot.style.top = -top + 'px';this._element.style.height = height + 'px';this._groupRoot.setAttributeNS(null,'transform','translate('+left+' '+top+')');},
clear : function() {
if(this._disposed) { return;}
this._svgRoot.innerHTML = '';},
setSymbol : function(shape,symbol) {
if(ESRI.ADF.Graphics.FillSymbol.isInstanceOfType(symbol)) { 
this._setFill(shape,symbol);}
else if(ESRI.ADF.Graphics.LineSymbol.isInstanceOfType(symbol)) { 
this._setStroke(shape,symbol);}
else if(ESRI.ADF.Graphics.MarkerSymbol.isInstanceOfType(symbol)) { 
this._setMarker(shape,symbol);}
},
_setStroke : function(shape, stroke)
{
if(stroke) {
shape.setAttributeNS(null, 'stroke', stroke.get_lineColor());shape.setAttributeNS(null, 'stroke-width', stroke.get_width());shape.setAttributeNS(null, 'stroke-opacity', stroke.get_opacity());shape.setAttributeNS(null, 'stroke-linecap', this._joinTypeToSvg(stroke.get_capType()));shape.setAttributeNS(null, 'stroke-linejoin', this._joinTypeToSvg(stroke.get_joinType()));if(stroke.get_dashPattern()) {
shape.setAttributeNS(null, 'stroke-dasharray', this._dashPatternToSvg(stroke.get_dashPattern(),stroke.get_width()));}
else {
shape.removeAttributeNS(null, 'stroke-dasharray');}
}
else { shape.setAttributeNS(null, 'stroke', 'none');}
},
_dashPatternToSvg : function(pattern,width) {
if(!pattern || pattern.length===0) { return 'none';}
if(String.isInstanceOfType(pattern)) {
switch (pattern.toLowerCase()) {
case "dash":
pattern = [2,2];break;case "dot":
pattern = [1,2];break;case "dash_dot":
pattern = [2,2,1,2];break;case "dash_dot_dot":
pattern = [2,2,1,2,1,2];break;default:
return "none";} 
}
for(var j=0;j<pattern.length;j++) {
pattern[j] = (pattern[j] === 1 ? 1 : Math.round(pattern[j]*width));}
return pattern.toString();}, 
_capTypeToSvg : function(captype) {
switch(captype) {
case ESRI.ADF.Graphics.CapType.Flat: return 'butt';case ESRI.ADF.Graphics.CapType.Square: return 'square';default: return 'round';}
},
_joinTypeToSvg : function(jointype) {
switch(jointype) {
case ESRI.ADF.Graphics.JoinType.Miter: return 'miter';case ESRI.ADF.Graphics.JoinType.Bevel: return 'bevel';default: return 'round';}
},
_setFill : function(shape, fill)
{
if(fill && fill.get_fillColor()!==null) {
shape.setAttributeNS(null, 'fill', fill.get_fillColor());shape.setAttributeNS(null, 'fill-opacity', fill.get_opacity());shape.setAttributeNS(null, 'fill-rule', 'evenodd');}
else {
shape.setAttributeNS(null, 'fill', 'none');}
this._setStroke(shape,fill.get_outline());},
setVertices : function(shape,pntArray,symbol) {
switch(shape.tagName.toLowerCase()) {
case 'path': shape.setAttributeNS(null, 'd', this._pntArrayToSvgPath(pntArray,shape.closed));break;case 'ellipse':
shape.setAttributeNS(null, 'cx', pntArray[0] + 'px');shape.setAttributeNS(null, 'cy', pntArray[1] + 'px');shape.setAttributeNS(null, 'rx', pntArray[2] + 'px');shape.setAttributeNS(null, 'ry', pntArray[3] + 'px');break;case 'div':
if(pntArray.length===2 && symbol) { 
shape.style.left = (pntArray[0] - symbol.get_centerX())+'px';shape.style.top = (pntArray[1] - symbol.get_centerY())+'px';}
break;case 'rect':
shape.setAttributeNS(null, 'x', Math.min(pntArray[0],pntArray[2]) + 'px');shape.setAttributeNS(null, 'y', Math.min(pntArray[1],pntArray[3]) + 'px');shape.setAttributeNS(null, 'width', Math.abs(pntArray[2]-pntArray[0])+ 'px');shape.setAttributeNS(null, 'height', Math.abs(pntArray[3]-pntArray[1]) + 'px');break;default: break;}
},
_setMarker : function(div,symbol) {
var img = div.childNodes[0];if(symbol.get_cursor()) { img.style.cursor = symbol.get_cursor();}
if(!img.src || !img.src.endsWith(symbol.get_imageUrl())) {
img.src = symbol.get_imageUrl();}
else { img.src = symbol.get_imageUrl();}
if(symbol.get_width() && symbol.get_height() && symbol.get_clipX()!==null && symbol.get_clipY()!==null) {
div.style.width = symbol.get_width() + 'px';div.style.height = symbol.get_height() + 'px';img.style.left = -symbol.get_clipX()+'px';img.style.top = -symbol.get_clipY()+'px';img.style.position = 'relative';div.style.overflow = 'hidden';}
else {
if(symbol.get_width()>0) { img.style.width = symbol.get_width() + 'px';}
else { img.style.width = 'auto';}
if(symbol.get_height()>0) { img.style.height = symbol.get_height() + 'px';}
else { img.style.height = 'auto';}
}
if(!symbol.get_imageFormat() || !symbol.get_imageFormat().startsWith('png32')) {
ESRI.ADF.System.setOpacity(div,symbol.get_opacity());}
},
createPolyline : function(pntArray) {
var line = this._svgRoot.ownerDocument.createElementNS(this.namespace, 'path');line.closed = false;this.setVertices(line,pntArray);line.setAttributeNS(null, 'fill', 'none');return line;},
createPolygon : function(pntArray) {
var shape = this._svgRoot.ownerDocument.createElementNS(this.namespace, 'path');shape.closed = true;this.setVertices(shape,pntArray);return shape;},
createEnvelope : function(pntArray) {
var shape = this._svgRoot.ownerDocument.createElementNS(this.namespace, 'rect');this.setVertices(shape,pntArray);return shape;},
createOval : function(pntArray) {
var shape = this._svgRoot.ownerDocument.createElementNS(this.namespace, 'ellipse');this.setVertices(shape,pntArray);return shape;},
addToCanvas : function(shape) {
if(shape.tagName.toLowerCase()==='div') {
this._element.appendChild(shape);}
else { this._groupRoot.appendChild(shape);}
shape.setAttributeNS(null, 'overflow', 'visible');},
_pntArrayToSvgPath : function(pntArray, close) {
var pathString = '';var j=0;var newline = true;pathString += 'M';while(j<pntArray.length) {
if(pntArray[j]!==null && j<pntArray.length-1) {
pathString = pathString.concat(pntArray[j]," ");pathString = pathString.concat(pntArray[j+1]," ");j++;if(newline) { pathString += "L";newline = false;}
}
else if(j<pntArray.length-2) {
if(close) { pathString += "Z";}
pathString += ' M';newline = true;}
j++;}
if(close) { pathString += "Z";}
return pathString;}
};ESRI.ADF.Graphics.__SvgCanvas.registerClass('ESRI.ADF.Graphics.__SvgCanvas', ESRI.ADF.Graphics.__Canvas);ESRI.ADF.Graphics.__VmlCanvas = function(element,transfunc) {
ESRI.ADF.Graphics.__VmlCanvas.initializeBase(this, [element,transfunc]);};ESRI.ADF.Graphics.__VmlCanvas.prototype = {
initialize : function() {
ESRI.ADF.Graphics.__VmlCanvas.callBaseMethod(this, 'initialize');this._element.unselectable = 'on';},
adjustCanvasExtent : function(left,top,height,width) {
},
clear : function() {
if(this._disposed) { return;}
this.get_element().innerHTML = '';},
setSymbol : function(shape,symbol) {
if(ESRI.ADF.Graphics.FillSymbol.isInstanceOfType(symbol)) { 
this._setFill(shape,symbol);}
else if(ESRI.ADF.Graphics.LineSymbol.isInstanceOfType(symbol)) { 
this._setStroke(shape,symbol);}
else if(ESRI.ADF.Graphics.MarkerSymbol.isInstanceOfType(symbol)) { 
this._setMarker(shape,symbol);}
},
addToCanvas : function(shape) {
this._element.appendChild(shape);},
_setStroke : function(shape,stroke) {
if(shape.tagName.toLowerCase()==='div') {
shape.style.border = 'solid '+stroke.get_width()+'px ' + stroke.get_lineColor();}
else {
var strokes = shape.getElementsByTagName("stroke");var strokeElem = this._createVmlStrokeElement(stroke);if(strokes.length>0) { shape.replaceChild(strokeElem,strokes[0]);}
else { shape.appendChild(strokeElem);}
}
if(stroke && stroke.get_cursor()) { shape.style.cursor = stroke.get_cursor();}
},
_setFill : function(shape, fill) {
if(shape.tagName.toLowerCase()==='div') {
shape.style.backgroundColor = fill.get_fillColor();shape.style.filter = 'alpha(opacity='+(fill.get_opacity()*100)+')';shape.style.opacity = fill.get_opacity();this._setStroke(shape,fill.get_outline());}
else {
this._setStroke(shape,fill.get_outline());var fills = shape.getElementsByTagName("fill");var fillElem = this._createVmlFillElement(fill);if(fills.length>0) { shape.replaceChild(fillElem,fills[0]);}
else { shape.appendChild(fillElem);}
if(fill.get_cursor()) { shape.style.cursor = fill.get_cursor();}
}
if(fill.get_cursor()) { shape.style.cursor = fill.get_cursor();}
},
_setMarker : function(div,symbol) {
var img = div.childNodes[0];if(symbol.get_cursor()) { img.style.cursor = symbol.get_cursor();}
if(!img.src || !img.src.endsWith(symbol.get_imageUrl())) {
if(ESRI.ADF.System.__isIE6) {
ESRI.ADF.System.setIEPngTransparency(img,symbol.get_imageUrl(),(!symbol.get_width() || !symbol.get_height()),symbol.get_imageFormat());}
else { img.src = symbol.get_imageUrl();}
}
else { img.src = symbol.get_imageUrl();}
if(symbol.get_width()>0 && symbol.get_height()>0 && symbol.get_clipX()!==null && symbol.get_clipY()!==null) {
div.style.width = symbol.get_width() + 'px';div.style.height = symbol.get_height() + 'px';img.style.left = -symbol.get_clipX()+'px';img.style.top = -symbol.get_clipY()+'px';img.style.position = 'relative';div.style.overflow = 'hidden';}
else {
if(symbol.get_width()>0) { img.style.width = symbol.get_width() + 'px';}
else { img.style.width = 'auto';}
if(symbol.get_height()>0) { img.style.height = symbol.get_height() + 'px';}
else { img.style.height = 'auto';}
}
if(!symbol.get_imageFormat() || !symbol.get_imageFormat().startsWith('png32')) {
ESRI.ADF.System.setOpacity(div,symbol.get_opacity());}
},
setVertices : function(shape,pntArray,symbol) {
switch(shape.tagName.toLowerCase()) {
case 'shape':
var path = this._pntArrayToVmlPath(pntArray,shape.filled===true || shape.filled==='t');if(shape.path !== path) { shape.path = path;}
break;case 'oval':
shape.style.left = pntArray[0]-pntArray[2];shape.style.top = pntArray[1]-pntArray[3];shape.style.width = pntArray[2]*2;shape.style.height = pntArray[3]*2;break;case 'div':
if(pntArray.length===2 && symbol) { 
shape.style.left = (pntArray[0] - symbol.get_centerX())+'px';shape.style.top = (pntArray[1] - symbol.get_centerY())+'px';}
break;case 'rect':
shape.style.left = Math.min(pntArray[0],pntArray[2])+'px';shape.style.top = Math.min(pntArray[1],pntArray[3])+'px';shape.style.width = Math.abs(pntArray[2]-pntArray[0])+'px';shape.style.height = Math.abs(pntArray[3]-pntArray[1])+'px';break;default: break;}
},
createPolyline : function(pntArray) {
var shape=document.createElement('v:shape');shape.style.width = this._element.offsetWidth;shape.style.height = this._element.offsetHeight;shape.coordsize = this._element.offsetWidth + ' ' + this._element.offsetHeight;shape.style.position = 'absolute';shape.unselectable = false;shape.filled = 'f';this.setVertices(shape,pntArray);return shape;},
createPolygon : function(pntArray) {
var shape=document.createElement("v:shape");shape.style.width = this._element.offsetWidth;shape.style.height = this._element.offsetHeight;shape.coordsize = this._element.offsetWidth + " " + this._element.offsetHeight;shape.style.position = 'absolute';shape.filled = 't';this.setVertices(shape,pntArray);return shape;},
createEnvelope : function(pntArray) {
var shape=document.createElement("v:rect");shape.style.position = 'absolute';shape.filled = 't';this.setVertices(shape,pntArray);return shape;},
createOval : function(pntArray) {
var shape=document.createElement("v:oval");shape.style.position = 'absolute';shape.filled = 't';this.setVertices(shape,pntArray);return shape;},
_createVmlFillElement : function(fill) {
var fillElem = document.createElement('v:fill');fillElem.type = 'solid';fillElem.color = fill.get_fillColor();if(!fill.get_fillColor()) { fillElem.opacity = '0.0';}
else { fillElem.opacity = fill.get_opacity();}
return fillElem;}, 
_createVmlStrokeElement : function(stroke) {
var strokeElem = document.createElement('v:stroke');if(stroke) {
strokeElem.color = stroke.get_lineColor();strokeElem.weight = stroke.get_width() + 'px';strokeElem.opacity = stroke.get_opacity();if (strokeElem.opacity == 0)
strokeElem.opacity = 0.01;strokeElem.endcap = this._capTypeToVml(stroke.get_capType());strokeElem.joinstyle = this._joinTypeToVml(stroke.get_joinType());strokeElem.dashstyle = this._dashPatternToVml(stroke.get_dashPattern());}
else { strokeElem.opacity = '0';}
return strokeElem;},
_dashPatternToVml : function(pattern) {
if(!pattern || pattern.length===0) { return 'solid';}
if(String.isInstanceOfType(pattern)) {
switch (pattern.toLowerCase()) {
case "dash":
return "2 2";case "dot":
return "1 1";case "dash_dot":
return "2 1 1";case "dash_dot_dot":
return "longdashdotdot";default:
return "solid";} 
}
else{
var dash = pattern[0];for(var j=1;j<pattern.length;j++) {
dash += ' ' + pattern[j];}
}
return dash;},
_capTypeToVml : function(captype) {
switch(captype) {
case ESRI.ADF.Graphics.CapType.Flat: return 'flat';case ESRI.ADF.Graphics.CapType.Square: return 'square';default: return 'round';}
},
_joinTypeToVml : function(jointype) {
switch(jointype) {
case ESRI.ADF.Graphics.JoinType.Miter: return 'miter';case ESRI.ADF.Graphics.JoinType.Bevel: return 'bevel';default: return 'round';}
},
_pntArrayToVmlPath : function(pntArray, close) {
var strBuilder = new Sys.StringBuilder();var j=0;var newline = true;strBuilder.append('m');while(j<pntArray.length) {
if(pntArray[j]!==null && j<pntArray.length-1) {
strBuilder.append(pntArray[j]);strBuilder.append(',');strBuilder.append(pntArray[j+1]);strBuilder.append(' ');j++;if(newline) { strBuilder.append('l');newline = false;}
}
else if(j<pntArray.length-2) {
if(close) { strBuilder.append('x');}
else { strBuilder.append('e');}
strBuilder.append('m');newline = true;}
j++;}
if(close) { strBuilder.append('x');}
else { strBuilder.append('e');}
return strBuilder.toString();}
};ESRI.ADF.Graphics.__VmlCanvas.registerClass('ESRI.ADF.Graphics.__VmlCanvas', ESRI.ADF.Graphics.__Canvas);if(Sys.Browser.agent === Sys.Browser.InternetExplorer) {
document.writeln('<xml:namespace ns="urn:schemas-microsoft-com:vml" prefix="v"/>\n');var ss = document.createStyleSheet();ss.addRule('v\\:shape', "behavior: url(#default#VML);");ss.addRule('v\\:fill', "behavior: url(#default#VML);");ss.addRule('v\\:rect', "behavior: url(#default#VML);");ss.addRule('v\\:oval', "behavior: url(#default#VML);");ss.addRule('v\\:stroke', "behavior: url(#default#VML);");}
ESRI.ADF.Graphics.ShapeType = function() {
};ESRI.ADF.Graphics.ShapeType.prototype = {
Point : 0,
Line: 1,
Path : 2,
Envelope : 10,
Circle : 11,
Oval : 12,
Ring : 13
};ESRI.ADF.Graphics.ShapeType.registerEnum("ESRI.ADF.Graphics.ShapeType", false);ESRI.ADF.Graphics.__GraphicsEditor = function(map,canvas,feature,featuretype,style,oncomplete,oncancel,continuous,cursor) {
this._map = map;this._cursor = cursor;this._canvas = canvas;this._feature = feature;this._featuretype = featuretype;this._oncomplete = oncomplete;this._oncancel = oncancel;this._canvas = canvas;this._draggingHandler = null;this._dragCompletehandler = null;this._clickHandler = null;this._dblclickHandler = null;this._zoomStartHandler = null;this._zoomCompletedHandler = null;this._moveHandler = null;this._style = style;this._disposed = false;this._continuous = continuous;this._initialize();};ESRI.ADF.Graphics.__GraphicsEditor.prototype = {
_initialize : function() { 
if(!this._style) {
if(this._featuretype >=10) {
this._style = new ESRI.ADF.Graphics.FillSymbol('blue','yellow',1.0);}
else {
this._style = new ESRI.ADF.Graphics.LineSymbol('red',2);}
}
if(this._feature) { this._startEditFeature();}
else { this._startGetFeature();}
},
dispose : function() {
if(this._disposed || this._disposing) { return;}
this._disposing = true;this._unhookEvents();this._geometry = null;this._pntColl = null;if(this._elmRef) { this._elmRef.parentNode.removeChild(this._elmRef);}
this._elmRef = null;this._oncancel = null;this._oncomplete = null;this._disposing = false;this._disposed = true;},
_hookEvents : function() {
this._orgMouseMode = this._map.get_mouseMode();this._oldcursor = this._map.get_cursor();this._map.set_mouseMode(ESRI.ADF.UI.MouseMode.Custom);if(this._cursor) { this._map.set_cursor(this._cursor);}
this._dblclickHandler = Function.createDelegate(this,this._onDblClick);this._moveHandler = Function.createDelegate(this,this._onMouseMove);this._mouseDownHandler = Function.createDelegate(this,this._onMouseDown);this._mouseUpHandler = Function.createDelegate(this,this._onMouseUp);this._zoomStartHandler = Function.createDelegate(this,this._onZoomStart);this._zoomCompletedHandler = Function.createDelegate(this,this._onZoomCompleted);this._map.add_dblclick(this._dblclickHandler);this._map.add_mouseMove(this._moveHandler);this._map.add_mouseDown(this._mouseDownHandler);this._map.add_mouseUp(this._mouseUpHandler);this._map.add_zoomStart(this._zoomStartHandler);this._map.add_zoomCompleted(this._zoomCompletedHandler);},
_unhookEvents: function() {
if(this._map.get_mouseMode()!==this._orgMouseMode) {
this._map.set_mouseMode(this._orgMouseMode);}
this._map.set_cursor(this._oldcursor);this._map.remove_dblclick(this._dblclickHandler);this._map.remove_mouseMove(this._moveHandler);this._map.remove_mouseDown(this._mouseDownHandler);this._map.remove_mouseUp(this._mouseUpHandler);this._map.remove_zoomStart(this._zoomStartHandler);this._map.remove_zoomCompleted(this._zoomCompletedHandler);this._draggingHandler = null;this._dragCompletehandler = null;this._clickHandler = null;this._dblclickHandler = null;this._moveHandler = null;this._zoomStartHandler = null;this._zoomCompletedHandler = null;},
_drawVertices : function() {
if(this._feature) {
if(ESRI.ADF.Geometries.Polygon.isInstanceOf(this._feature)) {
var rings = this._feature.get_geometry().get_rings();for(var r=0;r<rings.length;r++) {
var ring = rings[r];for(var v=0;v<ring.length;v++) {
var env = new ESRI.ADF.Geometries.Envelope(r[0]-1,r[1]-1,r[0]+1,r[1]+1);this._canvas.drawGeometry(env,null);}
}
}
}
},
_onMouseDown : function(sender,args) {
if(args.button === Sys.UI.MouseButton.leftButton && !this._pntColl && this._featuretype!==ESRI.ADF.Graphics.ShapeType.Point) {
this._pntColl = new ESRI.ADF.Geometries.CoordinateCollection([[args.coordinate.get_x(), args.coordinate.get_y()]]);}
}, 
_onMouseMove : function(sender,args) {
if(this._pntColl) {
var count = this._pntColl.get_count();if(count>0) {
if(args.ctrlKey) { 
var lastpnt = this._pntColl.getLast();if(Math.abs(lastpnt[0]-args.coordinate.get_x()) < Math.abs(lastpnt[1]-args.coordinate.get_y())) {
args.coordinate.set_x(lastpnt[0]);}
else { args.coordinate.set_y(lastpnt[1]);}
} 
this._pntColl.add([args.coordinate.get_x(), args.coordinate.get_y()]);if(this._featuretype===ESRI.ADF.Graphics.ShapeType.Ring) { this._pntColl.add(this._pntColl.get(0));}
this._drawGeometry();this._pntColl.removeAt(count);if(this._featuretype===ESRI.ADF.Graphics.ShapeType.Ring) { this._pntColl.removeAt(count);}
}
}
},
_onZoomStart : function(sender,args) {
this._canvas.get_element().style.display = 'none';},
_onZoomCompleted : function(sender,args) {
this._drawGeometry();this._canvas.get_element().style.display = '';},
_isTwoPointFeatureType : function() {
return (this._featuretype===ESRI.ADF.Graphics.ShapeType.Line ||
this._featuretype===ESRI.ADF.Graphics.ShapeType.Oval ||
this._featuretype===ESRI.ADF.Graphics.ShapeType.Circle || 
this._featuretype===ESRI.ADF.Graphics.ShapeType.Envelope);},
_onMouseUp : function(sender,e) {
if(e.button === Sys.UI.MouseButton.leftButton) {
this.__addPoint(e.coordinate,e.ctrlKey);}
else if(e.button === Sys.UI.MouseButton.rightButton) {
if(this._pntColl) {
var count = this._pntColl.get_count();if(count>1) {
this._pntColl.removeAt(count-1);this._onMouseMove(sender,e);}
else {
this._pntColl.clear();this._cancel(false);}
}
}
},
__addPoint : function(pnt,ortho) {
if(this._featuretype===ESRI.ADF.Graphics.ShapeType.Point) { 
this._geometry = pnt;this.__completeEditing();return;}
if(!this._pntColl) { this._pntColl = new ESRI.ADF.Geometries.CoordinateCollection();}
var px = pnt.get_x();var py = pnt.get_y();var lastpoint = this._pntColl.getLast();if(lastpoint) { 
if(ortho) {
if(Math.abs(lastpoint[0]-px) < Math.abs(lastpoint[1]-py)) {
px = lastpoint[0];}
else { py = lastpoint[1];}
}
}
var isTwoPoint = this._isTwoPointFeatureType();if(!lastpoint || isTwoPoint || Math.abs(lastpoint[0]- px)/this._map._pixelsizeX>2 || Math.abs(lastpoint[1]-py)/this._map._pixelsizeY>2) {
this._pntColl.add([px,py]);if(isTwoPoint && this._pntColl.get_count()===2) { 
this.__completeEditing();}
else { this._drawGeometry();}
}
},
_createGeometry : function() {
if(!this._pntColl) { this._geometry = null;return;}
switch(this._featuretype) {
case ESRI.ADF.Graphics.ShapeType.Ring:
this._geometry = new ESRI.ADF.Geometries.Polygon(this._pntColl);break;case ESRI.ADF.Graphics.ShapeType.Envelope:
if(this._pntColl.get_count()>1) {
var x1 = this._pntColl.get(0)[0];var y1 = this._pntColl.get(0)[1];var x2 = this._pntColl.get(1)[0];var y2 = this._pntColl.get(1)[1];this._geometry = new ESRI.ADF.Geometries.Envelope(Math.min(x1,x2),Math.min(y1,y2),Math.max(x1,x2),Math.max(y1,y2));}
else {
this._geometry = new ESRI.ADF.Geometries.Envelope(this._pntColl.get(0)[0],this._pntColl.get(0)[1],this._pntColl.get(0)[0],this._pntColl.get(0)[1]);}
break;case ESRI.ADF.Graphics.ShapeType.Path:
case ESRI.ADF.Graphics.ShapeType.Line:
this._geometry = new ESRI.ADF.Geometries.Polyline(this._pntColl);break;case ESRI.ADF.Graphics.ShapeType.Circle:
case ESRI.ADF.Graphics.ShapeType.Oval:
if(this._pntColl.get_count()>1) {
var a = (this._pntColl.get(1)[0]-this._pntColl.get(0)[0]);var b = (this._pntColl.get(1)[1]-this._pntColl.get(0)[1]);var scale = Math.sqrt(2);if(this._featuretype===ESRI.ADF.Graphics.ShapeType.Circle) {
a = b = Math.sqrt(a*a+b*b);}
else if(a!==0 && b!==0) {
a*=scale;b*=scale;}
this._geometry = new ESRI.ADF.Geometries.Oval(this._pntColl.getAsPoint(0),a*2,this._featuretype===ESRI.ADF.Graphics.ShapeType.Oval?b*2:null);}
else {
this._geometry = new ESRI.ADF.Geometries.Oval(this._pntColl.getAsPoint(0),0,0);}
break;default: this._geometry=null;}
},
_drawGeometry : function() {
this._createGeometry();if(!this._geometry) { return;}
if(this._elmRef) {
this._canvas.updateGeometry(this._geometry,this._style,this._elmRef);}
else {
this._elmRef = this._canvas.drawGeometry(this._geometry,this._style);}
},
_onDblClick : function(sender, args) {
if(this._pntColl && (this._pntColl.get_count()>1 && this._featuretype !== ESRI.ADF.Graphics.ShapeType.Ring ||
this._pntColl.get_count()>2)) {
this.__completeEditing();}
else if(this._featuretype === ESRI.ADF.Graphics.ShapeType.Envelope) {
if(this._pntColl==null) {
this.__addPoint(args.coordinate,false);}
this.__completeEditing();}
},
__completeEditing : function() {
if(this._featuretype === ESRI.ADF.Graphics.ShapeType.Ring) {
var firstPnt = this._pntColl.getFirst();var lastPnt = this._pntColl.getLast();if(firstPnt[0]!==lastPnt[0] || firstPnt[1]!==lastPnt[1]) {
this._pntColl.add([firstPnt[0],firstPnt[1]]);}
}
else if(this._featuretype === ESRI.ADF.Graphics.ShapeType.Envelope && this._pntColl.get_count()===1) {
var firstPnt = this._pntColl.getFirst();this._geometry = new ESRI.ADF.Geometries.Envelope(firstPnt[0],firstPnt[1],firstPnt[0],firstPnt[1]);}
else if (this._isTwoPointFeatureType()) {
if(this._pntColl.get_count()!==2) {
throw new Error.invalidOperation('Operation requires two points');}
this._createGeometry();}
if(this._oncomplete && this._geometry) { this._oncomplete(this._geometry);}
if(!this._continuous) { this.dispose();}
else {
this._pntColl = null;this._geometry = null;if(this._elmRef) {
this._elmRef.parentNode.removeChild(this._elmRef);this._elmRef=null;}
}
},
_startEditFeature : function(feature) {
this._drawVertices();this._hookEvents();},
_startGetFeature : function() {
this._hookEvents();},
_cancel : function(force) {
if(this._elmRef) {
this._elmRef.parentNode.removeChild(this._elmRef);this._elmRef = null;}
this._pntColl = null;this._geometry = null;if(force || !this._continuous) { if(this._oncancel){this._oncancel(true);} this.dispose();}
},
cancel : function() {
this._cancel(true);}
};ESRI.ADF.Graphics.__GraphicsEditor.registerClass('ESRI.ADF.Graphics.__GraphicsEditor');Type.registerNamespace('ESRI.ADF.Graphics.__AdfGraphicsLayer');ESRI.ADF.Graphics.__AdfGraphicsLayer.parseJsonLayer = function(json,map) {
var obj = Sys.Serialization.JavaScriptSerializer.deserialize(json);var name = map.get_id() + '_' + obj.tableName;var type = obj.type;var rows = obj.rows;var titleTemplate = obj.title;var contentTemplate = obj.contents;var opacity = (obj.opacity || obj.opacity===0?obj.opacity:1);var visible = (obj.visible!==false);var enableCallout = (obj.enableCallout!==false);var layer = null;var ftype = ESRI.ADF.Geometries.Geometry;var symbol = null;var selectedSymbol = null;var highlightSymbol = null;if(type === 'featureGraphicsLayer')
{
switch(obj.featureType) {
case 'point':
type = ESRI.ADF.Geometries.Point;break;case 'line':
type = ESRI.ADF.Geometries.Line;break;case 'polygon':
type = ESRI.ADF.Geometries.Polygon;break;default:
}
symbol = ESRI.ADF.Graphics.__AdfGraphicsLayer._parseSymbol(obj.symbol);if(obj.selectedSymbol) { selectedSymbol = ESRI.ADF.Graphics.__AdfGraphicsLayer._parseSymbol(obj.selectedSymbol);}
if(obj.highlightSymbol) { highlightSymbol = ESRI.ADF.Graphics.__AdfGraphicsLayer._parseSymbol(obj.highlightSymbol);}
}
layer = $find(name);if(layer) { 
map.removeGraphic(layer);layer.clear();layer.set_visible(visible);layer.set_symbol(symbol);layer.set_selectedSymbol(selectedSymbol);layer.set_highlightSymbol(highlightSymbol);}
else {
layer = $create(ESRI.ADF.Graphics.GraphicFeatureGroup,{"id":name,"visible":visible,"symbol":symbol,"selectedSymbol":selectedSymbol,"highlightSymbol":highlightSymbol});}
if(opacity!==null) { layer.set_opacity(opacity);}
Array.forEach(rows, function(row) { layer.add(ESRI.ADF.Graphics.__AdfGraphicsLayer._parseRow(row,name));});if(enableCallout) {
var id = '__ESRI_WebADF_gfxLayerCallout_' + name;var callout = $find(id);if(!callout) {
callout = $create(ESRI.ADF.UI.MapTips,{"animate":false,"hoverTemplate":titleTemplate,"contentTemplate":contentTemplate,"id":id});}
else {
callout.set_hoverTemplate(titleTemplate);callout.set_contentTemplate(contentTemplate);}
layer.set_mapTips(callout);}
else {
var callout = layer.get_mapTips();if(callout) {
layer.set_mapTips(null);callout.dispose();}
}
if(!ESRI.ADF.Graphics.__mapZoomEvent) {
ESRI.ADF.Graphics.__mapZoomEvent = {};ESRI.ADF.Graphics._mapMouseOver = function(sender,args) {
if(ESRI.ADF.Graphics._currentMouseHighlightElement) {
ESRI.ADF.Graphics._currentMouseHighlightElement.set_highlight(false);ESRI.ADF.Graphics._currentMouseHighlightElement = null;}
if(!args.element.get_highlight()) { 
args.element.set_highlight(true);ESRI.ADF.Graphics._currentMouseHighlightElement = args.element;}
};ESRI.ADF.Graphics._mapMouseOut = function(sender,args) {
if(ESRI.ADF.Graphics._currentMouseHighlightElement === args.element) { 
args.element.set_highlight(false);ESRI.ADF.Graphics._currentMouseHighlightElement = null;}
};}
layer.add_mouseOver(ESRI.ADF.Graphics._mapMouseOver);layer.add_mouseOut(ESRI.ADF.Graphics._mapMouseOut);if(!ESRI.ADF.Graphics.__mapZoomEvent[map.get_id()]) {
ESRI.ADF.Graphics.__mapZoomEvent[map.get_id()] = true;map.add_zoomStart(function() {
if(ESRI.ADF.Graphics._currentMouseHighlightElement) {
ESRI.ADF.Graphics._currentMouseHighlightElement.set_highlight(false);ESRI.ADF.Graphics._currentMouseHighlightElement=null;}
});}
return layer;};ESRI.ADF.Graphics.__AdfGraphicsLayer._parseRow = function(row,layerid) {
var geometry = ESRI.ADF.Graphics.__AdfGraphicsLayer._parseGeometry(row.geometry);var symbol = null;var selectedSymbol = null;var highlightSymbol = null;if(row.symbol) { symbol = ESRI.ADF.Graphics.__AdfGraphicsLayer._parseSymbol(row.symbol);}
if(row.selectedSymbol) { selectedSymbol = ESRI.ADF.Graphics.__AdfGraphicsLayer._parseSymbol(row.selectedSymbol);}
if(row.highlightSymbol) { highlightSymbol = ESRI.ADF.Graphics.__AdfGraphicsLayer._parseSymbol(row.highlightSymbol);}
var id = layerid+'_'+row.id;var feat = $find(id);if(feat) { feat.dispose();}
var gfx = $create(ESRI.ADF.Graphics.GraphicFeature,{"id":id,"isSelected":row.isSelected,"geometry":geometry,"symbol":symbol,"selectedSymbol":selectedSymbol,"highlightSymbol":highlightSymbol,"attributes":row.attributes});if(row.geometry.envelope) {
gfx._envelope = new ESRI.ADF.Geometries.Envelope(row.geometry.envelope[0],row.geometry.envelope[1],row.geometry.envelope[2],row.geometry.envelope[3]);}
return gfx;};ESRI.ADF.System.attributeTableRenderer = function(obj) {
if(!obj) { return '';}
var strBuilder = new Sys.StringBuilder();var content = '';strBuilder.append('<div onclick="return false;" onwheel="return false;"><table>');for(var key in obj) { strBuilder.append(String.format('<tr><td><b>{0}:</b></td><td>{1}</td></tr>',
key,obj[key]));}
strBuilder.append('</table></div>');return strBuilder.toString();};ESRI.ADF.Graphics.__AdfGraphicsLayer._parseSymbol = function(symbol) {
if(!symbol) { return null;}
switch(symbol.type) {
case 'marker':
return ESRI.ADF.Graphics.__AdfGraphicsLayer._parseMarkerSymbol(symbol);case 'line':
return ESRI.ADF.Graphics.__AdfGraphicsLayer._parseLineSymbol(symbol);case 'fill':
return ESRI.ADF.Graphics.__AdfGraphicsLayer._parseFillSymbol(symbol);default: return null;}
};ESRI.ADF.Graphics.__AdfGraphicsLayer._parseMarkerSymbol = function(symbol) {
var centerx = symbol.center?symbol.center[0]: (symbol.size[0]*0.5);var centery = symbol.center?symbol.center[1]: (symbol.size[1]*0.5);var marker = new ESRI.ADF.Graphics.MarkerSymbol(symbol.url,centerx,centery);if(symbol.opacity<1) { marker.set_opacity(symbol.opacity);}
marker.set_width(symbol.size[0]);marker.set_height(symbol.size[1]);if(symbol.format) { marker.set_imageFormat(symbol.format);}
return marker;};ESRI.ADF.Graphics.__AdfGraphicsLayer._parseLineSymbol = function(symbol) {
var line = new ESRI.ADF.Graphics.LineSymbol(symbol.color,symbol.width);line.set_dashPattern(symbol.lineType);if(symbol.opacity<1) { line.set_opacity(symbol.opacity);}
return line;};ESRI.ADF.Graphics.__AdfGraphicsLayer._parseFillSymbol = function(symbol) {
var fill=null;if(symbol.hasBoundary===true) {
fill = new ESRI.ADF.Graphics.FillSymbol(symbol.color,symbol.boundaryColor,symbol.boundaryWidth);fill.get_outline().set_dashPattern(symbol.boundaryType);if(symbol.BoundaryOpacity===0 || symbol.BoundaryOpacity<1) {
fill.get_outline().set_opacity(symbol.BoundaryOpacity);}
}
else { fill = new ESRI.ADF.Graphics.FillSymbol(symbol.color);}
if(symbol.opacity===0 || symbol.opacity<1) {
fill.set_opacity(symbol.opacity);}
return fill;};ESRI.ADF.Graphics.__AdfGraphicsLayer._parseGeometry = function(geom) {
if(!geom) { return null;}
switch(geom.type) {
case 'point':
return ESRI.ADF.Graphics.__AdfGraphicsLayer._parsePoint(geom);case 'multipoint':
return ESRI.ADF.Graphics.__AdfGraphicsLayer._parseMultiPoint(geom);case 'polyline':
return ESRI.ADF.Graphics.__AdfGraphicsLayer._parsePolyline(geom);case 'polygon':
return ESRI.ADF.Graphics.__AdfGraphicsLayer._parsePolygon(geom);case 'envelope':
return ESRI.ADF.Graphics.__AdfGraphicsLayer._parseEnvelope(geom);default: return null;}
};ESRI.ADF.Graphics.__AdfGraphicsLayer._parsePoint = function(geom) {
return new ESRI.ADF.Geometries.Point(geom.x,geom.y);};ESRI.ADF.Graphics.__AdfGraphicsLayer._parseMultiPoint = function(geom) {
var pnts = new ESRI.ADF.Geometries.GeometryCollection(ESRI.ADF.Geometries.Point);for(var j=0;j<geom.points.length;j++) {
pnts.add(new ESRI.ADF.Geometries.Point(geom.points[j][0],geom.points[j][1]));}
return pnts;};ESRI.ADF.Graphics.__AdfGraphicsLayer._parsePolyline = function(geom) {
var line = new ESRI.ADF.Geometries.Polyline();var paths = geom.paths;for(var j=0;j<paths.length;j++) {
line.addPath(new ESRI.ADF.Geometries.CoordinateCollection(paths[j]));}
return line;};ESRI.ADF.Graphics.__AdfGraphicsLayer._parsePolygon = function(geom) {
var poly = new ESRI.ADF.Geometries.Polygon();var rings = geom.rings;for(var j=0;j<rings.length;j++) {
poly.addRing(new ESRI.ADF.Geometries.CoordinateCollection(rings[j]));}
return poly;};ESRI.ADF.Graphics.__AdfGraphicsLayer._parseEnvelope = function(geom) {
return new ESRI.ADF.Geometries.Envelope(geom.coords[0],geom.coords[1],geom.coords[2],geom.coords[3]);};if (typeof(Sys) !== "undefined") { Sys.Application.notifyScriptLoaded();}

//END ESRI.ArcGIS.ADF.Web.UI.WebControls.Runtime.JavaScript.ESRI.ADF.Graphics.release.js
//START ESRI.ArcGIS.ADF.Web.UI.WebControls.Runtime.JavaScript.ESRI.ADF.UI.Callout.release.js
//----------------------------------------------------------
// Copyright (C) ESRI. All rights reserved.
//----------------------------------------------------------
Type.registerNamespace('ESRI.ADF.UI');ESRI.ADF.UI.AnchorPoint = function() {
throw Error.invalidOperation();};ESRI.ADF.UI.AnchorPoint.prototype = {
TopLeft : 0,
TopRight : 1,
BottomLeft : 2,
BottomRight : 3
};ESRI.ADF.UI.AnchorPoint.registerEnum("ESRI.ADF.UI.AnchorPoint", false);ESRI.ADF.UI.CalloutLayout = function() {
ESRI.ADF.UI.CalloutLayout.initializeBase(this);this._layout = ESRI.ADF.UI.defaultCalloutTemplate;};ESRI.ADF.UI.CalloutLayout.prototype = {
set_layout: function(value) {
this._layout = value;if (!value.template && value.templateUrl) {
this._getTemplate();}
else {
this._onLayoutChanged();}
},
get_layout: function() { return this._layout;},
_getTemplate: function() {
this._layout.template = null;var wRequest1 = new Sys.Net.WebRequest();wRequest1.set_url(this._layout.templateUrl);wRequest1.add_completed(Function.createDelegate(this, this._onTemplateLoaded));wRequest1.invoke();},
_onTemplateLoaded: function(executor, eventArgs) {
if (executor.get_responseAvailable()) {
this._layout.template = executor.get_responseData();this._onLayoutChanged();}
},
_onLayoutChanged: function() {
var handler = this.get_events().getHandler('layoutChanged');if (handler) { handler(this, this._layout);}
},
add_layoutChanged: function(handler) {
this.get_events().addHandler('layoutChanged', handler);},
remove_layoutChanged: function(handler) { this.get_events().removeHandler('layoutChanged', handler);}
};ESRI.ADF.UI.CalloutLayout.registerClass('ESRI.ADF.UI.CalloutLayout',Sys.Component);ESRI.ADF.UI.Callout = function() {
ESRI.ADF.UI.Callout.initializeBase(this);this._parent = document.body;this._usesDefaultTemplate = true;this._isHidden = true;this._animate = true;this._autoHide = true;this._verticalOffset = 0;this._clickHandler = Function.createDelegate(this, this._onClick);this._mouseoverHandler = Function.createDelegate(this, function(e) { this.stopHideTimer();this._raiseEvent('mouseOver', e);});this._mouseoutHandler = Function.createDelegate(this, function(e) { this.startHideTimer();this._raiseEvent('mouseOut', e);});this._anchorPoint = ESRI.ADF.UI.AnchorPoint.TopLeft;this._hideDelayTime = 500;this._layout = ESRI.ADF.UI.defaultCalloutTemplate.get_layout();this._usesDefaultTemplate = true;this._defaultSpriteSize = [1000, 998];};ESRI.ADF.UI.Callout.prototype = {
initialize: function() {
if (this._usesDefaultTemplate) {
this._layout = ESRI.ADF.UI.defaultCalloutTemplate.get_layout();ESRI.ADF.UI.defaultCalloutTemplate.add_layoutChanged(Function.createDelegate(this, function(s, layout) {
if (this._usesDefaultTemplate) {
this._layout = layout;this._refreshContent();}
}));}
if (this._layout.template) {
this._createCallout();}
else if (this._layout.templateUrl) { 
var wRequest1 = new Sys.Net.WebRequest();wRequest1.set_url(this._layout.templateUrl);wRequest1.add_completed(Function.createDelegate(this, this._onTemplateLoaded));wRequest1.invoke();}
ESRI.ADF.UI.Callout.callBaseMethod(this, 'initialize');},
_onTemplateLoaded: function(executor, eventArgs) {
if (executor.get_responseAvailable()) {
this._layout.template = executor.get_responseData();}
this._createCallout();},
_createCallout: function() {
this._calloutMain = document.createElement('div');this._arrowDiv = document.createElement('div');this._contentDiv = document.createElement('div');this._calloutMain.style.position = 'absolute';this._arrowDiv.style.position = 'absolute';this._arrowDiv.style.overflow = 'hidden';var abounds = this._layout.arrowBounds[this._anchorPoint ? this._anchorPoint : 0];this._arrowDiv.style.width = abounds[2] + 'px';this._arrowDiv.style.height = abounds[3] + 'px';this._arrowImage = document.createElement('img');this._arrowImage.style.position = 'absolute';this._arrowImage.style.width = 'auto';this._arrowImage.style.height = 'auto';this._setArrowImage();this._arrowDiv.appendChild(this._arrowImage);this._contentDiv.style.position = 'absolute';this._contentDiv.style.cursor = 'default';this._calloutMain.appendChild(this._contentDiv);this._calloutMain.appendChild(this._arrowDiv);this._calloutMain.style.zIndex = ESRI.ADF.UI.Callout._zIndex;this._animation1 = new AjaxControlToolkit.Animation.FadeAnimation(this._contentDiv, 0.25, 25, AjaxControlToolkit.Animation.FadeEffect.FadeIn, 0, 1, false);this._animation2 = new AjaxControlToolkit.Animation.FadeAnimation(this._contentDiv, 0.25, 25, AjaxControlToolkit.Animation.FadeEffect.FadeOut, 0, 1, false);this._animation1.add_ended(Function.createDelegate(this, function() { this._arrowDiv.style.display = '';}));this._animation2.add_ended(Function.createDelegate(this, function() { this._calloutMain.style.display = 'none';}));if (this._isHidden) {
this._calloutMain.style.display = 'none';this._arrowDiv.style.display = 'none';}
this._parent.appendChild(this._calloutMain);this.setContent(this._content);this._reorient();this.setPosition(0, 0);$addHandler(this._contentDiv, "click", this._clickHandler);$addHandler(this._contentDiv, 'mouseover', this._mouseoverHandler);$addHandler(this._contentDiv, 'mouseout', this._mouseoutHandler);$addHandler(this._contentDiv, 'mousedown', function(e) { e.stopPropagation();});},
_setArrowImage: function() {
if (!this._arrowImage) { return;}
if (ESRI.ADF.System.__isIE6) {
this._tmpimage = document.createElement('img');this._tmpimage.style.position = 'absolute';this._tmpimage.style.visibility = 'hidden';this._tmpimage.style.left = 0;this._tmpimage.style.top = 0;this._tmpimage.onload = Function.createDelegate(this, function() {
if (!this._tmpimage) return;if (this._tmpimage.offsetWidth == 0) { 
this._arrowImage.style.width = this._defaultSpriteSize[0] + 'px';this._arrowImage.style.height = this._defaultSpriteSize[1] + 'px';}
else {
this._arrowImage.style.width = this._tmpimage.offsetWidth + 'px';this._arrowImage.style.height = this._tmpimage.offsetHeight + 'px';}
this._tmpimage.onload = null;this._tmpimage.parentNode.removeChild(this._tmpimage);this._tmpimage.removeAttribute('src');delete this._tmpimage;});document.body.appendChild(this._tmpimage);this._tmpimage.src = this._layout.arrowUrl;this._arrowImage.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled='true', , sizingMethod = 'crop', src='" + this._layout.arrowUrl + "');";this._arrowImage.src = esriBlankImagePath;}
else {
this._arrowImage.src = this._layout.arrowUrl;}
},
get_width: function() {
return this._value;},
set_width: function(value) {
if (this._width !== value) {
this._width = value;this.setContent(this._content);}
},
set_layout: function(value) {
this._layout = value;this._usesDefaultTemplate = false;if (!this._calloutMain) { this._createCallout();}
else {
this._setArrowImage();this._refreshContent();}
},
get_layout: function() {
return this._layout;},
dispose: function() {
if (!this._calloutMain) { return;}
this.hide();$clearHandlers(this._contentDiv);this._calloutMain.parentNode.removeChild(this._calloutMain);this._calloutMain = null;this._parent = null;ESRI.ADF.UI.Callout.callBaseMethod(this, 'dispose');},
setContent: function(value) {
if (this._content != value) {
this._content = value;this._refreshContent();this.raisePropertyChanged("content");}
},
_refreshContent: function() {
if (!this.get_isInitialized() || !this._contentDiv) { return;}
var template = ESRI.ADF.System.templateBinder({ "callout_width": this._width ? this._width + 'px' : 'auto' }, this._layout.template);this._contentDiv.innerHTML = ESRI.ADF.System.templateBinder(this._content, template);this._reorient();},
setPosition: function(x, y) {
if (!this.get_isInitialized()) { return;}
this._calloutMain.style.left = x + 'px';this._calloutMain.style.top = y + 'px';},
getPosition: function() {
if (!this._calloutMain) { return null;}
return [parseInt(this._calloutMain.offsetLeft, 10), parseInt(this._calloutMain.offsetTop, 10)];},
checkPosition: function() {
this._reorient();},
_reorient: function() {
if (!this._contentDiv || this._contentDiv.style.display === 'none' || !this._contentDiv.parentNode) { return;}
var bounds = Sys.UI.DomElement.getBounds(this._contentDiv);if (bounds.width == 0 || bounds.height == 0) { return;}
var x = 0;var y = 0;if (this._anchorPoint == ESRI.ADF.UI.AnchorPoint.BottomRight) { x = y = -1;}
else if (this._anchorPoint === ESRI.ADF.UI.AnchorPoint.TopRight) { x = -1;}
else if (this._anchorPoint === ESRI.ADF.UI.AnchorPoint.BottomLeft) { y = -1;}
var x2 = (x === 0 ? 1 : -1);var y2 = (y === 0 ? 1 : -1);var abounds = this._layout.arrowBounds[this._anchorPoint ? this._anchorPoint : 0];this._arrowDiv.style.width = abounds[2] + 'px';this._arrowDiv.style.height = abounds[3] + 'px';this._arrowDiv.style.left = (abounds[2] * x + abounds[6] * x2) + 'px';this._arrowDiv.style.top = (abounds[3] * y + abounds[7] * y2) + 'px';this._arrowImage.style.left = (-abounds[0]) + 'px';this._arrowImage.style.top = (-abounds[1]) + 'px';var left = (bounds.width * x + (abounds[2] + abounds[4] + abounds[6]) * x2);this._contentDiv.style.left = left + 'px';this._contentDiv.style.top = (bounds.height * y + (abounds[5] + abounds[7] - this._verticalOffset) * y2) + 'px';if (ESRI.ADF.System.__isIE6) {
var tmp = this._contentDiv.style.marginRight;this._contentDiv.style.marginRight = "1px";this._contentDiv.style.marginRight = tmp;if(document.documentElement.dir == "rtl")
this._contentDiv.style.left = (left - 1 * (x==0?1:0)) + 'px';else
this._contentDiv.style.left = (left - 1 * x) + 'px';}
},
startHideTimer: function() {
this.stopHideTimer();if (this.get_autoHide()) {
this._timer = window.setTimeout(Function.createDelegate(this, this.hide), this._hideDelayTime);}
},
stopHideTimer: function() {
if (this._timer) {
window.clearTimeout(this._timer);this._timer = null;}
},
show: function() {
ESRI.ADF.UI.Callout._zIndex++;this._isHidden = false;if (!this.get_isInitialized()) { return;}
this._calloutMain.style.zIndex = ESRI.ADF.UI.Callout._zIndex;this._calloutMain.style.visibility = 'hidden';this._calloutMain.style.display = '';this._raiseEvent('show');this._reorient();if (this._animate) { this._animation1.play();}
else { this._arrowDiv.style.display = '';}
this._calloutMain.style.visibility = '';},
hide: function() {
if (this._isHidden) { return;}
if (this._animate) { this._animation2.play();}
else { this._calloutMain.style.display = 'none';}
this._arrowDiv.style.display = 'none';this._isHidden = true;this._raiseEvent('hide');},
_onClick: function(e) {
e.stopPropagation();this._raiseEvent('click');},
get_isOpen: function() {
return !this._isHidden;},
get_content: function() {
return this._content;},
get_autoHide: function() {
return this._autoHide;},
set_autoHide: function(value) {
if (this._autoHide != value) {
this._autoHide = value;this.raisePropertyChanged("autoHide");}
},
get_anchorPoint: function() {
return this._anchorPoint;},
set_anchorPoint: function(value) {
if (this._anchorPoint != value) {
this._anchorPoint = value;this._reorient();}
},
get_animate: function() {
return this._animate;},
set_animate: function(value) {
if (this._animate != value) { this._animate = value;}
},
get_parent: function() {
return this._parent;},
set_parent: function(value) { if (this._parent != value) { this._parent = value;} },
get_hideDelayTime: function() {
return this._hideDelayTime;},
set_hideDelayTime: function(value) { if (this._hideDelayTime != value) { this._hideDelayTime = value;} },
get_template: function() {
return this._layout.template;},
///////////////////////////////	
set_template: function(value) { this._layout.template = value;this._usesDefaultTemplate = false;this._refreshContent();},
get_templateUrl: function() {
return this._templateUrl;},
set_templateUrl: function(value) { this._templateUrl = value;this._usesDefaultTemplate = false;},
get_arrowImageUrl: function() {
return this._layout.arrowUrl;},
set_arrowImageUrl: function(value) { this._layout.arrowUrl = value;},
get_arrowSize: function() {
return this._arrowSettings.size;},
set_arrowSize: function(value) { this._arrowSettings.size = value;},
get_arrowOffset: function() {
return this._arrowSettings.offset;},
set_arrowOffset: function(value) { this._arrowSettings.offset = value;},
get_calloutBuffer: function() {
return this._arrowSettings.buffer;},
set_calloutBuffer: function(value) { this._arrowSettings.buffer = value;},
//////////////////////////////	
get_verticalOffset: function() {
return this._verticalOffset;},
set_verticalOffset: function(value) { this._verticalOffset = value;},
_raiseEvent: function(name, e) {
var handler = this.get_events().getHandler(name);if (handler) { if (!e) { e = Sys.EventArgs.Empty;} handler(this, e);}
},
add_closed: function(handler) {
this.get_events().addHandler('closed', handler);},
remove_closed: function(handler) { this.get_events().removeHandler('closed', handler);},
add_click: function(handler) {
this.get_events().addHandler('click', handler);},
remove_click: function(handler) { this.get_events().removeHandler('click', handler);},
add_show: function(handler) {
this.get_events().addHandler('show', handler);},
remove_show: function(handler) { this.get_events().removeHandler('show', handler);},
add_hide: function(handler) {
this.get_events().addHandler('hide', handler);},
remove_hide: function(handler) { this.get_events().removeHandler('hide', handler);},
add_mouseOut: function(handler) {
this.get_events().addHandler('mouseOut', handler);},
remove_mouseOut: function(handler) { this.get_events().removeHandler('mouseOut', handler);},
add_mouseOver: function(handler) {
this.get_events().addHandler('mouseOver', handler);},
remove_mouseOver: function(handler) { this.get_events().removeHandler('mouseOver', handler);}
};ESRI.ADF.UI.Callout.registerClass('ESRI.ADF.UI.Callout', Sys.Component);ESRI.ADF.UI.Callout._zIndex = 1000;ESRI.ADF.UI.MapTips = function() {
ESRI.ADF.UI.MapTips.initializeBase(this);this._clickHandler = Function.createDelegate(this, this._onCalloutClick);this._mouseOverHandler = Function.createDelegate(this, this._onMouseOverCallout);this._mouseOutHandler = Function.createDelegate(this, this._onMouseOutCallout);this._onMouseGfxOverHandler = Function.createDelegate(this, this._onMouseOverGfx);this._onMouseGfxOutHandler = Function.createDelegate(this, this._onMouseOutGfx);this._onMouseGfxMoveHandler = Function.createDelegate(this, this._onMouseMoveGfx);this._onCalloutShowHandler = Function.createDelegate(this, this._onCalloutShow);this._onCalloutHideHandler = Function.createDelegate(this, this._onCalloutHide);this._onZoomStartHandler = Function.createDelegate(this, function() { if (this._callout) { this._callout.hide();} window.clearTimeout(this._showDelayedTimer);this._showDelayedTimer = null;});this._onGridOriginChanged = Function.createDelegate(this, function() { this._currentElement = null;});this._onMapTipEventHandler = Function.createDelegate(this, this._onMapTipEvent);this._onCalloutContentChanged = Function.createDelegate(this, this._contentChanged);this._currentElement = null;this._hoverTemplate = '';this._contentTemplate = '';this._layout = ESRI.ADF.UI.defaultMapTipsTemplate.get_layout();this._map = null;this._callout = null;this._hoverLayers = [];this._animate = true;this._maxheight = 150;this._width = 250;this._isExpanded = false;this._maptipID = ESRI.ADF.UI.MapTips._maptipCount;this._isDisposed = false;this._autoHide = true;this._expandOnClick = true;this._showOnHover = true;this._usesDefaultTemplate = true;ESRI.ADF.UI.MapTips._maptipCount++;};ESRI.ADF.UI.MapTips.prototype = {
initialize: function() {
if (this._usesDefaultTemplate) {
ESRI.ADF.UI.defaultMapTipsTemplate.add_layoutChanged(Function.createDelegate(this, function(s, args) {
if (this._usesDefaultTemplate) {
this._layout = args;if (this._callout) {
this._callout.set_layout(this._createCalloutLayout())
this._setExpandCollapseState();}
else { this._setupCallout();}
}
}));}
if (this._layout.templateUrl && !this._layout.template) { 
var wRequest1 = new Sys.Net.WebRequest();wRequest1.set_url(this._layout.templateUrl);wRequest1.add_completed(Function.createDelegate(this, this._onTemplateLoaded));wRequest1.invoke();}
else { this._setupCallout();}
ESRI.ADF.UI.MapTips.callBaseMethod(this, 'initialize');},
_onTemplateLoaded: function(executor, eventArgs) {
if (executor.get_responseAvailable()) {
this._layout.template = executor.get_responseData();if (this._callout) {
this._callout.set_layout(this._createCalloutLayout())
this._setExpandCollapseState();}
else { this._setupCallout();}
}
},
set_template: function(value) {
this._layout.template = value;this._callout.set_layout(this._createCalloutLayout());this._usesDefaultTemplate = false;this._setExpandCollapseState();},
get_template: function() {
return this._layout.template;},
_bindTemplate: function(template) {
var settings = {
"maptip_contentID": this.get_maptipContentID(),
"maptip_titleID": this.get_maptipTitleID(),
"maptipID": this.get_id()
};return ESRI.ADF.System.templateBinder(settings, template);},
createTemplate: function() {
return null;},
set_layout: function(value) {
this._layout = value;if (this._layout.templateUrl && !this._layout.template) { 
var wRequest1 = new Sys.Net.WebRequest();wRequest1.set_url(this._layout.templateUrl);wRequest1.add_completed(Function.createDelegate(this, this._onTemplateLoaded));wRequest1.invoke();}
else {
this._callout.set_layout(this._createCalloutLayout());}
this._usesDefaultTemplate = false;this._setExpandCollapseState();},
get_layout: function() {
return this._layout;},
_onMapTipEvent: function(s, e) {
if (e.maptip === this || this._isDisposed) { return;}
this._callout.set_verticalOffset(0);if (e.action === 'show' && this._autoHide) {
this.collapse();this._callout.hide();window.clearTimeout(this._showDelayedTimer);this._showDelayedTimer = null;}
},
collapse: function() {
this._isExpanded = false;this._setExpandCollapseState();var handler = this.get_events().getHandler('collapsed');if (handler) { handler(this, this._currentElement);}
this._raiseMapTipEvent("collapse");},
expand: function() {
this._isExpanded = true;this._setExpandCollapseState();var handler = this.get_events().getHandler('expanded');if (handler) { handler(this, this._currentElement);}
this._raiseMapTipEvent("expand");},
_setExpandCollapseState: function() {
var content = $get(this.get_maptipContentID());if (!content) { return;}
if (this._isExpanded) { content.style.display = '';}
else { content.style.display = 'none';}
this.adjustHeight();this._callout.checkPosition();if (ESRI.ADF.System.__isIE6) {
var tmp = content.style.width;content.style.width = '';content.style.width = tmp;}
},
_contentChanged: function(s, e) {
var prop = e.get_propertyName();if (prop !== 'content') { return;}
var tip = $get(this.get_maptipContentID());if (tip) {
if (tip.style.display === 'none' && this._isExpanded) { tip.style.display = '';}
else if (tip.style.display !== 'none' && !this._isExpanded) { tip.style.display = 'none';}
this.adjustHeight();}
},
_createCalloutLayout: function() {
var layoutClone = Sys.Serialization.JavaScriptSerializer.deserialize(Sys.Serialization.JavaScriptSerializer.serialize(this._layout));var settings = {
"callout_width": this._width + 'px',
"maptip_contentID": this.get_maptipContentID(),
"maptip_titleID": this.get_maptipTitleID(),
"maptipID": this.get_id()
};layoutClone.templateUrl = null;var template = this.createTemplate();if (template) { layoutClone.template = template;}
else { layoutClone.template = this._bindTemplate(this._layout.template);}
return layoutClone;},
_setupCallout: function() {
if (this._callout || !this._map) { return;}
this._callout = $create(ESRI.ADF.UI.Callout, {
"parent": this._map._containerDiv, "animate": this._animate,
"layout": this._createCalloutLayout(), "autoHide": this._autoHide,
"width": this._width, "id": this.get_id() + '_callout'
}, {
"click": this._clickHandler, "propertyChanged": this._onCalloutContentChanged,
"hide": this._onCalloutHideHandler, "show": this._onCalloutShowHandler,
"mouseOver": this._mouseOverHandler, "mouseOut": this._mouseOutHandler
}
);this._map.add_zoomStart(this._onZoomStartHandler);this._map.add_gridOriginChanged(this._onGridOriginChanged);this._map.__add_mapTipEvent(this._onMapTipEventHandler);this._setExpandCollapseState();},
addGraphics: function(gfxLayer) {
if (!this._callout && !this._map) {
if (gfxLayer._map) {
this._map = gfxLayer._map;this._setupCallout();}
}
gfxLayer.add_mouseOver(this._onMouseGfxOverHandler);gfxLayer.add_mouseOut(this._onMouseGfxOutHandler);gfxLayer.add_mouseMove(this._onMouseGfxMoveHandler);gfxLayer.add_click(this._clickHandler);Array.add(this._hoverLayers, gfxLayer);},
removeGraphics: function(gfxLayer) {
gfxLayer.remove_mouseOver(this._onMouseGfxOverHandler);gfxLayer.remove_mouseOut(this._onMouseGfxOutHandler);gfxLayer.remove_mouseMove(this._onMouseGfxMoveHandler);gfxLayer.remove_click(this._clickHandler);Array.remove(this._hoverLayers, gfxLayer);},
dispose: function() {
Array.forEach(this._hoverLayers, Function.createDelegate(this, function(layer) { this.removeGraphics(layer);}));if (this._map) {
this._map.remove_zoomStart(this._onMapTipEventHandler);this._map.remove_gridOriginChanged(this._onGridOriginChanged);this._map.__remove_mapTipEvent(this._onZoomStartHandler);}
if (this._callout) { this._callout.dispose();}
this._callout = null;this._currentElement = null;this._isDisposed = true;ESRI.ADF.UI.MapTips.callBaseMethod(this, 'dispose');},
_onMouseOverGfx: function(sender, e) {
if (!this._showOnHover) { return;};if (this._currentElement != e.element) {
this._callout.set_verticalOffset(0);this.collapse();this._callout.hide();this._setContentByElement(e.element);if (ESRI.ADF.Geometries.Point.isInstanceOfType(e.element.get_geometry())) {
this.setPosition(e.element.get_geometry());}
else {
var evt = ESRI.ADF.System._makeMouseEventRelativeToElement(e, this._callout.get_parent());this._callout.setPosition(evt.offsetX, evt.offsetY);}
}
this._callout.stopHideTimer();this._showDelayedTimer = window.setTimeout(Function.createDelegate(this, function() {
this._callout.show();if (ESRI.ADF.System.__isIE6) {
var content = $get(this.get_maptipContentID());var tmp = content.style.width;content.style.width = '';content.style.width = tmp;}
}), 500);},
_onMouseMoveGfx: function(sender, evt) {
if (this._showDelayedTimer && !this._callout.get_isOpen() && this._showOnHover &&
this._currentElement === evt.element && !ESRI.ADF.Geometries.Point.isInstanceOfType(evt.element.get_geometry())) {
var e = ESRI.ADF.System._makeMouseEventRelativeToElement(evt, this._callout.get_parent());this._callout.setPosition(e.offsetX, e.offsetY);}
},
setPosition: function(point) {
var pos = this._map._toMapScreen(point);this._callout.setPosition(pos.offsetX, pos.offsetY);},
adjustHeight: function() {
if (this._callout._calloutMain.style.display === 'none') { 
this._callout._calloutMain.style.visible = 'hidden';this._callout._calloutMain.style.display = '';}
var pos = this._callout.getPosition();var offset = [parseInt(this._callout._parent.style.left, 10), parseInt(this._callout._parent.style.top, 10)];var position = [offset[0] + pos[0], offset[1] + pos[1]];var centScreen = this._map.toScreenPoint(this._map.get_extent().get_center());var align = 0;if (position[1] > this._map._mapsize[1] / 2) { align += 2;}
if (position[0] > this._map._mapsize[0] / 2) { align++;}
var height = this._map._mapsize[1];var offsety = this._callout._layout.arrowBounds[this._callout._anchorPoint ? this._callout._anchorPoint : 0][5];var tip = $get(this.get_maptipContentID());if (tip) {
var bottomhalf = (position[1] > centScreen.offsetY);var dist = (bottomhalf ? position[1] : height - position[1]);tip.style.height = '';var tipHeight = parseInt(this._callout._contentDiv.offsetHeight, 10);var contentHeight = parseInt(tip.offsetHeight, 10);var titleHeight = tipHeight - contentHeight;var maxContentHeight = height - titleHeight;var adjustedHeight = null;if (maxContentHeight && maxContentHeight < contentHeight) { adjustedHeight = maxContentHeight;}
if (this._maxheight && (adjustedHeight && adjustedHeight > this._maxheight || contentHeight > this._maxheight)) { adjustedHeight = this._maxheight;}
if (adjustedHeight) { tip.style.height = adjustedHeight + 'px';contentHeight = adjustedHeight;}
var os = contentHeight + titleHeight - dist + offsety * 2;if (os < 0) os = 0;this._callout.set_verticalOffset(os);}
else { this._callout.set_verticalOffset(0);}
if (this._callout.get_anchorPoint() != align) { this._callout.set_anchorPoint(align);}
else { this._callout.checkPosition();}
if (this._callout._calloutMain.style.visible === 'hidden') { 
this._callout._calloutMain.style.display = 'none';this._callout._calloutMain.style.visible = '';}
},
_onMouseOutGfx: function(sender, e) {
if (!this._showOnHover) { return;}
if (this._showDelayedTimer) { window.clearTimeout(this._showDelayedTimer);this._showDelayedTimer = null;}
if (this._callout.get_isOpen() && this._autoHide) { this._callout.startHideTimer();}
},
_setContentByElement: function(element) {
var title = ESRI.ADF.System.templateBinder(element.get_attributes(), this._hoverTemplate);var content = '';var attr = element.get_attributes()
if (!this._contentTemplate) {
if (attr) { content = ESRI.ADF.System.attributeTableRenderer(attr);}
}
else { content = ESRI.ADF.System.templateBinder(attr, this._contentTemplate);}
if (!title) { title = '<div style="width:10px;">&nbsp;</div>';} 
this.setContent(content, title);this._currentElement = element;this._setExpandCollapseState();},
_onCalloutClick: function() {
if (this._expandOnClick) { this.expand();}
},
_onCalloutShow: function() {
this.adjustHeight();this._raiseMapTipEvent("show");},
_onCalloutHide: function() {
this._raiseMapTipEvent("hide");},
_raiseMapTipEvent: function(action) {
if (this._map) { this._map._raiseEvent('mapTipEvent', { "maptip": this, "element": this._currentElement, "action": action });}
},
_onMouseOverCallout: function() {
if (this._currentElement) {
this._currentHighlight = this._currentElement;}
},
_onMouseOutCallout: function(e) {
if (this._currentElement && this.autoHide) {
this._callout.startHideTimer();}
},
setContent: function(content, title) {
this._callout.setContent({ "content": content, "title": title });},
get_animate: function() {
if (this.get_isInitialized()) { return this._callout.get_animate();}
else { return this._animate;}
},
set_animate: function(value) {
this._animate = value;if (this.get_isInitialized()) { this._callout.set_animate(value);}
},
get_maxheight: function() {
return this._maxheight;},
set_maxheight: function(value) {
this._maxheight = value;},
get_width: function() {
return this._width;},
set_width: function(value) {
this._width = value;if (this._callout != null) {
this._callout.set_width(value);}
},
get_showOnHover: function() {
return this._showOnHover;},
set_showOnHover: function(value) {
this._showOnHover = value;if (value === false && this._callout) { this._callout.hide();}
},
__set_map: function(value) {
if (this._callout && this._map != value) {
throw new Error.invalidOperation('Cannot change the map on MapTips once initialized');}
this._map = value;this._setupCallout();},
get_callout: function() {
return this._callout;},
get_contentTemplate: function() {
return this._contentTemplate;},
set_contentTemplate: function(value) {
this._contentTemplate = value;},
get_hoverTemplate: function() {
return this._hoverTemplate;},
set_hoverTemplate: function(value) { this._hoverTemplate = value;},
set_autoHide: function(value) {
this._autoHide = value;},
get_autoHide: function() {
return this._autoHide;},
get_expandOnClick: function() {
return this._expandOnClick;},
set_expandOnClick: function(value) { this._expandOnClick = value;},
get_isExpanded: function() {
return this._isExpanded;},
get_maptipContentID: function() {
return "content_" + this._maptipID;},
get_maptipTitleID: function() {
return "title_" + this._maptipID;},
add_expanded: function(handler) {
this.get_events().addHandler('expanded', handler);},
remove_expanded: function(handler) { this.get_events().removeHandler('expanded', handler);},
add_collapsed: function(handler) {
this.get_events().addHandler('collapsed', handler);},
remove_collapsed: function(handler) { this.get_events().removeHandler('collapsed', handler);}
};ESRI.ADF.UI.MapTips.registerClass('ESRI.ADF.UI.MapTips', Sys.Component);ESRI.ADF.UI.MapTips._maptipCount = 0;ESRI.ADF.UI.createMapTips = function(gfxLayer,map) {
return new ESRI.ADF.UI.MapTips(gfxLayer,map);};Sys.Application.add_init(function() {
var calloutSettings = {
"template": '<div style="background-color:#ffa;border: solid 1px #eee;padding: 0px; margin:0;width:{@callout_width}" ><div style="padding:0;">{@content}</div></div>',
"templateUrl": null,
"arrowUrl": ESRI.ADF.UI.calloutArrowUrl,
"arrowBounds": [
[0, 0, 18, 30, 0, 6, 5, 5], 
[20, 0, 18, 30, 0, 6, 5, 5], 
[0, 30, 18, 30, 0, 6, 5, 5], 
[20, 30, 18, 30, 0, 6, 5, 5] 
]
};ESRI.ADF.UI.defaultCalloutTemplate = new ESRI.ADF.UI.CalloutLayout();ESRI.ADF.UI.defaultCalloutTemplate.set_layout(calloutSettings);var spriteStyle = String.format(".esriDefaultMaptip .esriDefaultMaptipWindowSprite {{ background-image:url({0}); width:1000px; height:998px; _background-image:none; _filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled='true', sizingMethod='crop', src='{0}'); }}", ESRI.ADF.UI._maptipsSprite);var pa = document.getElementsByTagName('head')[0];var el = document.createElement('style');el.type = 'text/css';el.media = 'screen';if (el.styleSheet) el.styleSheet.cssText = spriteStyle;else el.appendChild(document.createTextNode(spriteStyle));pa.appendChild(el);var isRTL = (document.documentElement.dir == "rtl");var maptipSettings = {
"template": '<div style="width:{@callout_width}; position:relative; color: #000;" class="esriDefaultMaptip"><div style="height:5px"><div style="position: absolute; height:5px; width:50%; left:0; overflow:hidden;"><div style="left:0px; position:absolute;" class="esriDefaultMaptipWindowSprite"></div></div><div style="position: absolute; height:5px; width:50%; right:0; overflow:hidden;"><div style="right:0px; position:absolute;" class="esriDefaultMaptipWindowSprite"></div></div></div><div style="position:relative; overflow:hidden;"><div style="overflow:hidden; width: 100%; position:relative; top:0;"><div style="position: absolute; left:0; top:-5px; width:100%; height:998px;"><div style="position: absolute; width:50%; height:100%; left:0; overflow:hidden;"><div class="esriDefaultMaptipWindowSprite" style="left:0;position:absolute;"></div></div><div style="position: absolute; width:50%; height:100%; right:0; overflow:hidden;"><div style="right: 0px;position:absolute;" class="esriDefaultMaptipWindowSprite"></div></div></div><div style="margin:0 10px 0px 10px;position:relative; top:0px;"><div id="{@maptip_titleID}" style="font-weight: bold; width:100%;" class="esriDefaultMaptipWindowTitle">{@title}&nbsp;</div><div id="{@maptip_contentID}" style="background-color:#fff; display:none; margin:0;position:relative; top:0px; overflow:auto;font-size:10pt;width:100%" class="esriDefaultMaptipWindowContent">{@content}</div></div><div id="close" onclick="$find(\'{@maptipID}\').get_callout().hide();" style="cursor:pointer; position: absolute;' + (isRTL ? 'left' : 'right') + ':10px;top:4px;width:7px; height:6px; overflow:hidden;"><div class="esriDefaultMaptipWindowSprite" style="position:absolute;left:-951px; top:-945px;"></div></div></div></div><div style="height:5px;position:relative;"><div style="left:0; top:0; width:50%;overflow:hidden;height:100%;position:absolute;"><div style="bottom:0;position:absolute;left:0" class="esriDefaultMaptipWindowSprite"></div></div><div style="right:0; top:0; width:50%;overflow:hidden;height:100%;position:absolute;"><div style="right:0;bottom:0px;position:absolute;" class="esriDefaultMaptipWindowSprite"></div></div></div></div>',
"templateUrl": null, 
"arrowUrl": ESRI.ADF.UI._maptipsSprite,
"arrowBounds": [
[954, 921, 16, 17, -1, -3, 5, -7], 
[939, 921, 16, 17, -1, -3, 5, -7], 
[954, 921, 16, 17, -1, -3, 5, -7], 
[939, 921, 16, 17, -1, -3, 5, -7] 
]
};ESRI.ADF.UI.defaultMapTipsTemplate = new ESRI.ADF.UI.CalloutLayout();ESRI.ADF.UI.defaultMapTipsTemplate.set_layout(maptipSettings);});if (typeof(Sys) !== "undefined") { Sys.Application.notifyScriptLoaded();}

//END ESRI.ArcGIS.ADF.Web.UI.WebControls.Runtime.JavaScript.ESRI.ADF.UI.Callout.release.js
//START ESRI.ArcGIS.ADF.Web.UI.WebControls.Runtime.JavaScript.ESRI.ADF.Layers.release.js
//----------------------------------------------------------
// Copyright (C) ESRI. All rights reserved.
//----------------------------------------------------------
Type.registerNamespace('ESRI.ADF.Layers');ESRI.ADF.Layers.LayerCollection = function() {
ESRI.ADF.Layers.LayerCollection.initializeBase(this);this._resources = [];this._levels = null;this._pendingResourceCount=0;this._resourceChangedHandler = Function.createDelegate(this, this._resourceChanged);};ESRI.ADF.Layers.LayerCollection.prototype = {
dispose : function() {
for(var idx=0;idx<this._resources.length;idx++) {
this._resources[idx].dispose();}
Array.clear(this._resources);ESRI.ADF.Layers.LayerCollection.callBaseMethod(this, 'dispose');},
add : function(layer) {
Array.add(this._resources, layer);if(!layer.get_isInitialized())
{
layer.add_initialized(Function.createDelegate(this,this._onResourceInitialized));this._pendingResourceCount++;}
else if(this._pendingResourceCount===0) {
this._calculateLevelScheme();}
var handler = this.get_events().getHandler('layerAdded');if (handler) { handler(this, layer);}
layer.add_propertyChanged(this._resourceChangedHandler);},
insert : function(layer,index) {
Array.insert(this._resources,index,layer);if(!layer.get_isInitialized())
{
layer.add_initialized(Function.createDelegate(this,this._onResourceInitialized));this._pendingResourceCount++;}
else if(this._pendingResourceCount===0) {
this._calculateLevelScheme();}
var handler = this.get_events().getHandler('layerAdded');if (handler) { handler(this, layer);}
layer.add_propertyChanged(this._resourceChangedHandler);},
remove : function(layer) {
Array.remove(this._resources, layer);if(!layer.get_isInitialized())
{
layer.remove_initialized(this._onResourceInitialized);this._pendingResourceCount--;}
else { this._calculateLevelScheme();}
var handler = this.get_events().getHandler('layerRemoved');if (handler) { handler(this, layer);}
layer.remove_propertyChanged(this._resourceChangedHandler);},
indexOf : function(layer) {
return Array.indexOf(this._resources,layer);},
get_layer : function(index) {
return this._resources[index];},
get_layerCount : function() {
return this._resources.length;},
_onResourceInitialized : function(s,e) {
this._pendingResourceCount--;if(this._pendingResourceCount===0) {
this._calculateLevelScheme();var handler = this.get_events().getHandler('layersInitialized');if (handler) { handler(this, Sys.EventArgs.Empty);}
}
},
get_hasPendingLayers : function() {
return (this._pendingResourceCount>0);},
get_extent : function() {
if(this._resources.length===0) { return null;}
var extent = this._resources[0].get_extent();for(var idx=1;idx<this._resources.length;idx++) {
if(this._resources[idx].get_isInitialized()) {
extent = extent.join(this._resources[idx].get_extent());}
}
return extent;},
__hasTiledResources : function() {
Sys.Debug.trace('__hasTiledResources is obsolete. Use __hasLevels');for(var idx=0;idx<this._resources.length;idx++) {
if(ESRI.ADF.Layers.TileLayer.isInstanceOfType(this._resources[idx])) {
return true;} 
}
return false;},
__hasLevels : function() {
for(var idx=0;idx<this._resources.length;idx++) {
if(ESRI.ADF.Layers.TileLayer.isInstanceOfType(this._resources[idx])) {
return true;}
else if(this._resources[idx]._levels) {
return true;}
}
return false;},
getLevelByNearestPixelsize : function(pixelsize) {
if(!this._levels) { return null;}
var level = 0;for(var idx=1;idx<this._levels.length;idx++)
{
if(Math.abs(this._levels[idx]-pixelsize)<Math.abs(this._levels[level]-pixelsize)) {
level = idx;}
}
return level;},
get_levelResolution : function(level) {
if(this._levels) { return this._levels[level];}
else { return null;}
},
_calculateLevelScheme : function() {
if(this.get_layerCount()===0) { this._levels = null;return;} 
if(!this.__hasLevels()) { 
this._levels = null;}
else {
this._levels = [];for(var idx=0;idx<this._resources.length;idx++) {
if(ESRI.ADF.Layers.TileLayer.isInstanceOfType(this._resources[idx])) {
var levels = this._resources[idx].get_levels();for(var j=0;j<levels.length;j++) {
if(!Array.contains(this._levels,levels[j].get_resX())) {
Array.add(this._levels,levels[j].get_resX());}
}
}
else if(this._resources[idx].get_levels()) {
var levels = this._resources[idx].get_levels();for(var j=0;j<levels.length;j++) {
if(!Array.contains(this._levels,levels[j])) {
Array.add(this._levels,levels[j]);}
}
}
}
this._levels.sort(function(a,b){return (a<b?-1:1);});for(var k=this._levels.length-1;k>0;k--) {
if(this._resolutionsAreSame(this._levels[k],this._levels[k-1])) {
Array.remove(this._levels,this._levels[k]);}
}
this._levels.reverse();}
},
_resourceChanged : function(sender, args) {
var handler = this.get_events().getHandler('layerChanged');if (handler) { handler(this, {"resource": sender, "eventArgs": args});}
},
_resolutionsAreSame : function(r1,r2) {
if(r1===r2) { return true;}
return (Math.abs(256.0/r1*r2-256.0)<0.5);},
get_levels : function() {
return this._levels;},
add_layersInitialized : function(handler) {
this.get_events().addHandler('layersInitialized', handler);},
remove_layersInitialized : function(handler) { this.get_events().removeHandler('layersInitialized', handler);},
add_layerAdded : function(handler) {
this.get_events().addHandler('layerAdded', handler);},
remove_layerAdded : function(handler) { this.get_events().removeHandler('layerAdded', handler);},
add_layerRemoved : function(handler) {
this.get_events().addHandler('layerRemoved', handler);},
remove_layerRemoved : function(handler) { this.get_events().removeHandler('layerRemoved', handler);},
add_layerChanged : function(handler) {
this.get_events().addHandler('layerChanged', handler);},
remove_layerChanged : function(handler) { this.get_events().removeHandler('layerChanged', handler);}
};ESRI.ADF.Layers.LayerCollection.registerClass('ESRI.ADF.Layers.LayerCollection', Sys.Component);ESRI.ADF.Layers.Layer = function(id, extent, sref) {
if(id) { this.set_id(id);}
ESRI.ADF.Layers.Layer.initializeBase(this);this._extent = extent;this._spatialReference = sref;this._opacity = 1;this._visible = true;this._functionalities = [];};ESRI.ADF.Layers.Layer.prototype = {
initialize : function() {
ESRI.ADF.Layers.Layer.callBaseMethod(this, 'initialize');if(!this._name) { this._name = this.get_id();}
var handler = this.get_events().getHandler('initialized');if (handler) { handler(this, Sys.EventArgs.Empty);}
},
get_extent : function() {
return this._extent;},
set_extent : function(extent) {
if(extent && !ESRI.ADF.Geometries.Envelope.isInstanceOfType(extent)) { throw Error.argumentType('extent',Object.getType(extent),ESRI.ADF.Geometries.Envelope);}
if(this._extent !== extent && (!extent || !this._extent ||
extent.get_xmin()!==this._extent.get_xmin() || extent.get_ymin()!==this._extent.get_ymin() ||
extent.get_xmax()!==this._extent.get_xmax() || extent.get_ymax()!==this._extent.get_ymax())) {
this._extent=extent;this.raisePropertyChanged('extent');}
},
get_imageFormat : function() {
return this._imageFormat;},
set_imageFormat : function(value) {
this._imageFormat = value;},
get_name : function() {
return this._name;},
set_name : function(value) {
this._name = value;},
get_spatialReference : function() {
return this._spatialReference;},
set_spatialReference : function(value) {
this._spatialReference = value;},
get_opacity : function() {
return this._opacity;},
set_opacity : function(value) {
if(this._opacity !== value) {
this._opacity = value;this.raisePropertyChanged('opacity');}
},
get_visible : function() {
return this._visible;},
set_visible : function(value) {
if(this._visible !== value) {
this._visible = value;this.raisePropertyChanged('visible');}
},
add_initialized : function(handler) {
this.get_events().addHandler('initialized', handler);},
remove_initialized : function(handler) { this.get_events().removeHandler('initialized', handler);}
};ESRI.ADF.Layers.Layer.registerClass('ESRI.ADF.Layers.Layer', Sys.Component);ESRI.ADF.Layers.LevelInfo = function(tileHeight,tileWidth,rows,columns,resX,resY,minrow,mincol) {
this._tileHeight = tileHeight;this._tileWidth = tileWidth;this._rows = rows;this._columns = columns;this._minRow = (minrow?minrow:0);this._minCol = (mincol?mincol:0);this._resX = resX;this._resY = (resY?resY:resX);};ESRI.ADF.Layers.LevelInfo.prototype = {
get_tileHeight : function() {
return this._tileHeight;},
set_tileHeight : function(value) { this._tileHeight = value;},
get_tileWidth : function() {
return this._tileWidth;},
set_tileWidth : function(value) { this._tileWidth = value;},
get_rows : function() {
return this._rows;},
set_rows : function(value) { this._rows = value;},
get_columns : function() {
return this._columns;},
set_columns : function(value) { this._columns = value;},
get_minRow : function() {
return this._minRow;},
set_minRow : function(value) { this._minRow = value;},
get_minCol : function() {
return this._minCol;},
set_minCol : function(value) { this._minCol = value;},
get_resX : function() {
return this._resX;},
set_resX : function(value) { this._resX = value;},
get_resY : function() {
return this._resY;},
set_resY : function(value) { this._resY = value;}
};ESRI.ADF.Layers.LevelInfo.registerClass('ESRI.ADF.Layers.LevelInfo');ESRI.ADF.Layers.TileLayer = function(id, extent, levels, sref) {
ESRI.ADF.Layers.TileLayer.initializeBase(this, [id, extent, sref]);this._levels = (levels?levels:[]);};ESRI.ADF.Layers.TileLayer.prototype = {
getTileUrl : function(column,row,level,handler) {
throw(new Error.notImplemented('getTileUrl'));},
getLevelExtent : function(level) {
var dx = 0;var dy = 0;if(this._tileOrigin) {
dx = this._tileOrigin.get_x();dy = this._tileOrigin.get_y();}
else 
{
dx = this._extent.get_xmin();dy = this._extent.get_ymax();}
var levelinfo = this._levels[level];var tilewidth = levelinfo.get_tileWidth()*levelinfo.get_resX();var tileheight = levelinfo.get_tileHeight()*levelinfo.get_resY();dx += levelinfo.get_minCol() * tilewidth;dy -= levelinfo.get_minRow() * tileheight;return new ESRI.ADF.Geometries.Envelope( 
dx , dy - (levelinfo.get_rows())*tileheight,
dx + (levelinfo.get_columns())*tilewidth, dy,
this._spatialReference);},
getTileExtent : function(column,row,level) {
var dx = 0;var dy = 0;if(this._tileOrigin) {
dx = this._tileOrigin.get_x();dy = this._tileOrigin.get_y();}
else 
{
dx = this._extent.get_xmin();dy = this._extent.get_ymax();}
var lvl = this._levels[level];return new ESRI.ADF.Geometries.Envelope(
new ESRI.ADF.Geometries.Point(
(column)*lvl._tileWidth*lvl.get_resX()+dx,
dy - (row+1)*lvl._tileHeight*lvl.get_resY()),
new ESRI.ADF.Geometries.Point(
(column+1)*lvl._tileWidth*lvl.get_resX()+dx,
dy - (row) * lvl._tileHeight*lvl.get_resY()),
this._spatialReference);},
getTileSpanWithin : function(envelope, level) {
envelope = envelope.intersection(this.getLevelExtent(level));if(envelope) {
var dx = 0;var dy = 0;if(this._tileOrigin) {
dx = this._tileOrigin.get_x();dy = this._tileOrigin.get_y();}
else 
{
dx = this._extent.get_xmin();dy = this._extent.get_ymax();}
var lvl = this._levels[level];var res = lvl.get_resX();var colStart = Math.floor((envelope.get_xmin()-dx+lvl._resX*0.5) / (res * lvl._tileWidth));var rowStart = Math.floor((dy-envelope.get_ymax()+lvl._resY*0.5) / (res * lvl._tileHeight)) ;var colEnd = Math.floor((envelope.get_xmax()-dx-lvl._resX*0.5) / (res * lvl._tileWidth));var rowEnd = Math.floor((dy-envelope.get_ymin()+lvl._resY*0.5) / (res * lvl._tileHeight));if(rowEnd>=lvl.get_rows()+lvl.get_minRow()) { rowEnd = lvl.get_rows()+lvl.get_minRow()-1;}
if(colEnd>=lvl.get_columns()+lvl.get_minCol()) { colEnd = lvl.get_columns()+lvl.get_minCol()-1;}
return [ colStart, rowStart, colEnd, rowEnd ];}
else { return [ 0, 0, -1, -1 ];}
},
getLevelByNearestPixelsize : function(pixelsizeX) {
var level = 0;for(var idx=1;idx<this._levels.length;idx++)
{
if(Math.abs(this._levels[idx].get_resX()-pixelsizeX)<Math.abs(this._levels[level].get_resX()-pixelsizeX)) {
level = idx;}
}
return level;},
getLevelInfo : function(level) {
return this._levels[level];},
get_minimumResolution : function() {
return this._levels[0].get_resX();},
set_minimumResolution : function() {
throw new Error.invalidOperation('Cannot set minimum resolution on a tiled resource');},
get_maximumResolution : function() {
return this._levels[this._levels.length-1].get_resX();},
set_maximumResolution : function() {
throw new Error.invalidOperation('Cannot set maximum resolution on a tiled resource');},
get_tileOrigin : function() {
return this._tileOrigin;},
set_tileOrigin : function(value) { this._tileOrigin = value;},
get_levels : function() {
return this._levels;},
set_levels : function(value) { this._levels = value;} 
};ESRI.ADF.Layers.TileLayer.registerClass('ESRI.ADF.Layers.TileLayer',ESRI.ADF.Layers.Layer);ESRI.ADF.Layers.DynamicLayer = function(id, extent, sref) {
ESRI.ADF.Layers.DynamicLayer.initializeBase(this, [id, extent, sref]);this._extent = extent;this._spatialReference = null;this._useTiling = false;this._tilesize = null;this._minimumResolution = 0;this._maximumResolution = Number.MAX_VALUE;this._levels = null;};ESRI.ADF.Layers.DynamicLayer.prototype = {
getUrl : function(minx,miny,maxx,maxy,width,height,handler) {
throw(new Error.notImplemented('getUrl'));},
get_minimumResolution : function() {
return this._minimumResolution;},
set_minimumResolution : function(value) {
this._minimumResolution = value;},
get_maximumResolution : function() {
return this._maximumResolution;},
set_maximumResolution : function(value) {
this._maximumResolution = value;},
get_useTiling : function() {
return this._useTiling;},
set_useTiling : function(value) {
this._useTiling = value;},
get_tilesize : function() {
return this._tilesize;},
set_tilesize : function(value) {
this._tilesize = value;},
get_levels : function() {
return this._levels;}, 
set_levels : function(value) {
this._levels = value;}
};ESRI.ADF.Layers.DynamicLayer.registerClass('ESRI.ADF.Layers.DynamicLayer',ESRI.ADF.Layers.Layer);ESRI.ADF.Layers.AdfTileHandler = function() {
ESRI.ADF.Layers.AdfTileHandler.initializeBase(this);this._onCompleteHandler = Function.createDelegate(this,this._onComplete);this._timeout = 90000;};ESRI.ADF.Layers.AdfTileHandler.prototype = {
getTileUrl: function(c, r, level, handler) {
if (c >= 0 && r >= 0) { 
if (ESRI.ADF.System.checkSessionExpired && ESRI.ADF.System.checkSessionExpired()) { return;}
var argument = '&Row=' + r + '&Column=' + c + '&Level=' + level + '&t=' + (new Date()).getTime();var wRequest = new Sys.Net.WebRequest();wRequest.add_completed(this._onCompleteHandler);wRequest.set_url(this._tileHandlerUrl + argument);wRequest.set_userContext(handler);wRequest.set_timeout(this._timeout);wRequest.invoke();}
},
_onComplete: function(executor, eventArgs) {
var handler = executor.get_webRequest().get_userContext();var url = executor.get_webRequest().get_url();if (executor.get_responseAvailable()) {
if (ESRI.ADF.System.resetSessionLapse) { ESRI.ADF.System.resetSessionLapse();}
var result = executor.get_responseData();var obj = null;try { obj = Sys.Serialization.JavaScriptSerializer.deserialize(result);}
catch (ex) {
this._raiseError('Invalid JSON response: ' + result, url, null);handler('');return;}
if (obj.code && obj.code !== 200) {
if (obj.type === 'error') {
this._raiseError('DrawTile returned error: ' + obj.errorMessage, url, obj.code);}
else {
Sys.Debug.trace('DrawTile returned message: ' + obj.errorMessage);}
handler('');}
else if (!obj.url && obj.url !== '') {
this._raiseError('Invalid response', url, executor.get_statusCode());handler('');}
else if (obj.url === '') {
this._raiseError('Returned empty URL', url, executor.get_statusCode());handler('');}
else { handler(obj.url);}
}
else if (executor.get_timedOut()) {
this._raiseError('Response timed out', url, null);handler('');}
else if (executor.get_aborted()) {
this._raiseError('Request was aborted', url, null);handler('');}
else {
this._raiseError('Empty response', url, executor.get_statusCode());handler('');}
},
_raiseError: function(message, url, statusCode) {
Sys.Debug.trace('MapHandler error\nmessage:' + message + '\n url:' + url + '\nresource:' + this.get_id() + '\nstatus code:' + statusCode);var handler = this.get_events().getHandler('requestError');if (handler) { handler(this, { "errorMessage": message, "url": url, "statusCode": statusCode });}
},
add_requestError: function(handler) {
this.get_events().addHandler('requestError', handler);},
remove_requestError: function(handler) { this.get_events().removeHandler('requestError', handler);},
get_tileHandlerUrl: function() {
return this._tileHandlerUrl;},
set_tileHandlerUrl: function(value) {
this._tileHandlerUrl = value;},
get_timeout: function() {
return this._timeout;},
set_timeout: function(value) { this._timeout = value;}
};ESRI.ADF.Layers.AdfTileHandler.registerClass('ESRI.ADF.Layers.AdfTileHandler',ESRI.ADF.Layers.TileLayer);ESRI.ADF.Layers.AdfMapHandler = function() {
ESRI.ADF.Layers.AdfMapHandler.initializeBase(this);this._onCompleteHandler = Function.createDelegate(this,this._onComplete);this._timeout = 90000;};ESRI.ADF.Layers.AdfMapHandler.prototype = {
getUrl: function(minx, miny, maxx, maxy, width, height, handler) {
if (ESRI.ADF.System.checkSessionExpired && ESRI.ADF.System.checkSessionExpired()) { return;}
var argument = '&Extent=' + minx + ',' + miny + ',' + maxx + ',' + maxy + '&Width=' + width + '&Height=' + height + '&t=' + (new Date()).getTime();var wRequest = new Sys.Net.WebRequest();wRequest.add_completed(this._onCompleteHandler);wRequest.set_url(this._mapHandlerUrl + argument);wRequest.set_userContext(handler);wRequest.set_timeout(this._timeout);wRequest.invoke();},
_onComplete: function(executor, eventArgs) {
var handler = executor.get_webRequest().get_userContext();var url = executor.get_webRequest().get_url();if (executor.get_responseAvailable()) {
if (ESRI.ADF.System.resetSessionLapse) { ESRI.ADF.System.resetSessionLapse();}
var result = executor.get_responseData();var obj = null;try { obj = Sys.Serialization.JavaScriptSerializer.deserialize(result);}
catch (ex) {
this._raiseError('Invalid JSON response: ' + result, url, null);handler('');return;}
if (obj.code && obj.code !== 200) {
if (obj.type === 'error') {
this._raiseError('DrawImage returned error: ' + obj.errorMessage, url, obj.code);}
else {
Sys.Debug.trace('DrawImage returned message: ' + obj.errorMessage);}
handler('');}
else if (!obj.url && obj.url !== '') {
this._raiseError('Invalid response', url, executor.get_statusCode());handler('');}
else if (obj.url === '') {
this._raiseError('Returned empty URL', url, executor.get_statusCode());handler('');}
else {
if (obj.imageExtent) {
handler(obj.url, new ESRI.ADF.Geometries.Envelope(obj.imageExtent[0], obj.imageExtent[1], obj.imageExtent[2], obj.imageExtent[3]));}
else { handler(obj.url);}
}
}
else if (executor.get_timedOut()) {
this._raiseError('Response timed out', url, null);handler('');}
else if (executor.get_aborted()) {
this._raiseError('Request was aborted', url, null);handler('');}
else {
this._raiseError('Empty response', url, executor.get_statusCode());handler('');}
},
_raiseError: function(message, url, statusCode) {
Sys.Debug.trace('MapHandler error\nmessage:' + message + '\n url:' + url + '\nresource:' + this.get_id() + '\nstatus code:' + statusCode);var handler = this.get_events().getHandler('requestError');if (handler) { handler(this, { "errorMessage": message, "url": url, "statusCode": statusCode });}
},
add_requestError: function(handler) {
this.get_events().addHandler('requestError', handler);},
remove_requestError: function(handler) { this.get_events().removeHandler('requestError', handler);},
get_mapHandlerUrl: function() {
return this._mapHandlerUrl;},
set_mapHandlerUrl: function(value) { this._mapHandlerUrl = value;},
get_timeout: function() {
return this._timeout;},
set_timeout: function(value) { this._timeout = value;}
};ESRI.ADF.Layers.AdfMapHandler.registerClass('ESRI.ADF.Layers.AdfMapHandler',ESRI.ADF.Layers.DynamicLayer);ESRI.ADF.Layers.AdfMapPageHandler = function() {
ESRI.ADF.Layers.AdfMapPageHandler.initializeBase(this);this._requestIdCounter=0;this._handlers = {};};ESRI.ADF.Layers.AdfMapPageHandler.prototype = {
getUrl : function(minx,miny,maxx,maxy,width,height,handler) {
if(ESRI.ADF.System.checkSessionExpired && ESRI.ADF.System.checkSessionExpired()) { return;}
var id = this._requestIdCounter++;var argument = 'EventArg=GetImage&resource='+this.get_id()+'&ID='+id+'&Extent=' + minx + ',' + miny + ',' + maxx + ',' + maxy + '&Width=' + width + '&Height=' + height + '&t='+(new Date()).getTime();this._handlers['Request_'+id] = handler;this._map.doCallback(argument,this);},
processCallbackResult : function(action,params) {
if(action === 'GetImage') {
var obj = params[0];var id = obj.id;var handler = this._handlers['Request_'+id];if(handler) {
if(obj.error) { this._raiseError('GetImage returned error: ' + obj.error);handler('');}
if(obj.imageExtent) { handler(obj.url, new ESRI.ADF.Geometries.Envelope(obj.imageExtent[0],obj.imageExtent[1],obj.imageExtent[2],obj.imageExtent[3]));}
else { handler(obj.url);}
}
return true;}
return false;},
_raiseError : function(message) {
Sys.Debug.trace('MapPageHandler error: ' + message);var handler = this.get_events().getHandler('requestError');if (handler) { handler(this, {"errorMessage": message });}
},
add_requestError : function(handler) {
this.get_events().addHandler('requestError', handler);},
remove_requestError : function(handler) { this.get_events().removeHandler('requestError', handler);},
get_map : function() {
return this._map;},
set_map : function(value) { this._map = value;}
};ESRI.ADF.Layers.AdfMapPageHandler.registerClass('ESRI.ADF.Layers.AdfMapPageHandler',ESRI.ADF.Layers.DynamicLayer);ESRI.ADF.Layers.AdfTileDirectAccess = function() {
this._tileUrlGeneratorFunction = null;this._serverUrl = null;ESRI.ADF.Layers.AdfTileDirectAccess.initializeBase(this);};ESRI.ADF.Layers.AdfTileDirectAccess.prototype = {
getTileUrl : function(c,r,level,handler) {
handler(this._tileUrlGeneratorFunction(level, c, r, this._serverUrl));},
get_tileUrlGeneratorFunction : function() {
return this._tileUrlGeneratorFunction;},
set_tileUrlGeneratorFunction : function(value) {
this._tileUrlGeneratorFunction = value;},
get_serverUrl : function() {
return this._serverUrl;},
set_serverUrl : function(value) {
this._serverUrl = value;}
};ESRI.ADF.Layers.AdfTileDirectAccess.registerClass('ESRI.ADF.Layers.AdfTileDirectAccess',ESRI.ADF.Layers.TileLayer);if (typeof(Sys) !== "undefined") { Sys.Application.notifyScriptLoaded();}

//END ESRI.ArcGIS.ADF.Web.UI.WebControls.Runtime.JavaScript.ESRI.ADF.Layers.release.js
//START ESRI.ArcGIS.ADF.Web.UI.WebControls.Runtime.JavaScript.ESRI.ADF.UI.Map.release.js
//----------------------------------------------------------
// Copyright (C) ESRI. All rights reserved.
//----------------------------------------------------------
Type.registerNamespace('ESRI.ADF.UI');ESRI.ADF.UI.MouseMode = function() {
throw Error.invalidOperation();};ESRI.ADF.UI.MouseMode.prototype = {
None: 0,
Pan: 1,
ZoomIn: 2,
ZoomOut: 3,
Custom: 99
};ESRI.ADF.UI.MouseMode.registerEnum("ESRI.ADF.UI.MouseMode", false);ESRI.ADF.UI.MapBase = function(element) {
ESRI.ADF.UI.MapBase.initializeBase(this, [element]);this._layers = null;this._mouseDragState = null;this._isZooming = false;this._extent = null;this._cursor = 'crosshair';this._pixelsizeX = 1.0;this._pixelsizeY = this._pixelsizeX;this._disableScrollWheelZoom = false;this._keyPanDirection = [0, 0];this._mapsize = null;this._graphicFeatures = [];this._gridOrigin = new ESRI.ADF.Geometries.Point(0, 0);this._mouseMode = null;this._altAction = null;this._ctrlAction = null;this._mapsize = this._getInternalElementSize(this.get_element());this._extentHistory = [];this._currentExtentHistory = null;this._mouseWheelDirection = 1;this._keyActions = [];this._rotation = { "angle": 0, "cos": 1, "sin": 0 };this._progressBarEnabled = true;this._clipExtentBuffer = 50;this._layerReferences = {};this._animationSettings = { "duration": 0.25, "fps": 25, "enableFadeTransition": !ESRI.ADF.System.__isIE6, "disableNavigationAnimation": false };this._fadingStarted = true;this._isPanning = false;this._minZoom = 0;this._maxZoom = Number.POSITIVE_INFINITY;this._progressBarAlignment = ESRI.ADF.System.ContentAlignment.BottomRight;this._tileBuffer = null;this._loadTilesContinously = true;};ESRI.ADF.UI.MapBase.prototype = {
initialize: function() {
ESRI.ADF.UI.MapBase.callBaseMethod(this, 'initialize');if (!this._mouseMode) { this._mouseMode = ESRI.ADF.UI.MouseMode.Pan;}
this._setupMap();if (this._extentHistory.length === 0) {
this._addExtentHistory();}
this.add_zoomStart(Function.createDelegate(this, function() {
this._clearRequestStack();this._isZooming = true;this._clearVectorGraphics();this._tmpExtent = this.get_extent();this._fadingStarted = false;}));this.add_zoomCompleted(Function.createDelegate(this, function() {
this._isZooming = false;this._oldLayersDiv = this._layersDiv;this._oldLayersDiv.id = '';for (var idx in this._oldLayersDiv.childNodes) {
if (this._oldLayersDiv.childNodes[idx]) {
this._oldLayersDiv.childNodes[idx].id = '';}
}
this._layersDiv = this._createLayersDiv();this._containerDiv.insertBefore(this._layersDiv, this._annotationDiv);this._oldLayersDiv.style.left = this._containerDivPos[0] + 'px';this._oldLayersDiv.style.top = this._containerDivPos[1] + 'px';this._resetGridOffset();if (Sys.Browser.agent === Sys.Browser.InternetExplorer && this._animationSettings.enableFadeTransition && !this._animationSettings.disableNavigationAnimation) {
this._layersDiv.style.filter = "progid:DXImageTransform.Microsoft.Fade(overlap=1, duration=0.5)";this._layersDiv.filters[0].Apply();}
if (this._suppressExtentChanged !== true) {
this._raiseEvent('extentChanged', { "previous": this._tmpExtent, "current": this.get_extent() });}
this._tmpExtent = null;}));this.add_click(Function.createDelegate(this, this._onClick));this.add_mouseDragging(Function.createDelegate(this, this._onMouseDragging));this.add_mouseDragCompleted(Function.createDelegate(this, this._onMouseDragCompleted));this.add_panning(Function.createDelegate(this, function() {
if (!this._panPanPositionTracker) {
this._panPanPositionTracker = [this._containerDivPos[0], this._containerDivPos[1]];if (this._loadTilesContinously) { this._loadTilesInView();}
}
else {
var dist = Math.max(
Math.abs(this._containerDivPos[0] - this._panPanPositionTracker[0]),
Math.abs(this._containerDivPos[1] - this._panPanPositionTracker[1]));if (dist > 64) {
this._panPanPositionTracker = [this._containerDivPos[0], this._containerDivPos[1]];if (this._loadTilesContinously) { this._loadTilesInView();}
}
}
this._raiseEvent('extentChanging');}));this.add_panCompleted(Function.createDelegate(this, function(s, e) {
this._extent = null;this._panPanPositionTracker = null;this._removeOutsideTiles();if (this._suppressExtentChanged !== true) {
this._raiseEvent('extentChanged', e);}
this._tmpExtent = null;}));var del = Function.createDelegate(this, function(s, e) {
this._extent = null;this._addExtentHistory(e.previous, e.current);this._loadLayersInView(false);});this.add_extentChanged(del);$addHandlers(this.get_element(), {
'dblclick': this._onDblClick,
'mousedown': this._onMouseDown,
'contextmenu': function() { return false;}
}, this);this._mouseMoveHandler = Function.createDelegate(this, this._onMouseMove);this._mouseUpHandler = Function.createDelegate(this, this._onMouseUp);if (Sys.Browser.agent === Sys.Browser.InternetExplorer) {
$addHandlers(this.get_element(), {
'mouseenter': Function.createDelegate(this, this._hookEventsOnMouseEnter),
'mouseleave': Function.createDelegate(this, this._unhookEventsOnMouseLeave)
}, this);}
else {
$addHandlers(this.get_element(), {
'mouseover': Function.createDelegate(this, this._hookEventsOnMouseEnter),
'mouseout': Function.createDelegate(this, this._unhookEventsOnMouseLeave)
}, this);}
this._onKeyDownHandler = Function.createDelegate(this, this._onKeyDown);this._onKeyUpHandler = Function.createDelegate(this, this._onKeyUp);this._onWindowResizeHandler = Function.createDelegate(this, this._onResize);this._onWindowBlurHandler = Function.createDelegate(this, function() { this._fireKeyUpAction('all');});$addHandler(window, 'resize', this._onWindowResizeHandler);$addHandler(window, 'blur', this._onWindowBlurHandler);if (Sys.Browser.agent === Sys.Browser.Firefox) {
$addHandler(window, 'mouseout', Function.createDelegate(this, function(e) { if (e.target === document.body.parentNode && this._mouseDragState) { this._onMouseUp(e);} }));}
if (!this._disableScrollWheelZoom) { ESRI.ADF.System.addMouseWheelHandler(this.get_element(), this._onMouseWheel, this);}
this._hookupLayerCollectionEvents();},
_createProgressBar: function() {
this._progressBar = $create(ESRI.ADF.UI.ProgressBarExtender, { "width": "200px", "progressBarAlignment": this._progressBarAlignment }, null, { "map": this.get_id() });},
_hookupLayerCollectionEvents: function() {
if (!this._layers) { this._layers = new ESRI.ADF.Layers.LayerCollection();}
if (!this._layers.get_hasPendingLayers() && this._layers._resources.length > 0) { this._loadLayersInView(true);}
this._layers.add_layerAdded(Function.createDelegate(this, function(sender, args) {
if (this._layers.get_layerCount() === 1) { 
var resource = this._layers.get_layer(0);if (resource.get_isInitialized()) { 
this._loadFirstResource();}
else {
resource.add_initialized(Function.createDelegate(this, this._loadFirstResourceAndLayersInView));}
}
if (!this._layers.get_hasPendingLayers()) {
if (ESRI.ADF.Layers.DynamicLayer.isInstanceOfType(args)) {
this.refreshLayer(args);}
else { this._loadLayersInView(true);}
}
else { args.add_initialized(Function.createDelegate(this, function() { this._loadLayersInView() }));}
}));this._layers.add_layersInitialized(Function.createDelegate(this, this._loadLayersInView));this._layers.add_layerRemoved(Function.createDelegate(this, function(s, e) {
this._clearResourceImageTiles(e);var layerid = this._getLayerId(e);this._removeElement(this._layerReferences[layerid]);this._layerReferences[layerid] = null;this._removePendingStackStartingWith(layerid, true, false);}));},
dispose: function() {
if (this._progressBar) { this._progressBar.dispose();}
$removeHandler(window, 'resize', this._onWindowResizeHandler);$removeHandler(window, 'blur', this._onWindowBlurHandler);if (this._layers) { this._layers.dispose();}
$clearHandlers(this.get_element());ESRI.ADF.UI.MapBase.callBaseMethod(this, 'dispose');},
_loadFirstResource: function() {
var resource = this.get_layers().get_layer(0);var level = this._layers.getLevelByNearestPixelsize(this._pixelsizeX);if (level === null) { this._pixelsizeY = this._pixelsizeX;}
else { this._pixelsizeX = this._pixelsizeY = this.get_layers().get_levelResolution(level);}
this.set_spatialReference(resource.get_spatialReference());this._applyExtent(this.get_extent());this.refreshGraphics();},
_loadFirstResourceAndLayersInView: function() {
this._loadFirstResource();this._loadLayersInView(true);},
_setupMap: function() {
if (!this.get_cursor()) { this.set_cursor('move');}
this._controlDiv = document.createElement('div');var MapControlDiv = this._controlDiv;MapControlDiv.style.overflow = 'hidden';MapControlDiv.style.width = '100%';MapControlDiv.style.height = '100%';MapControlDiv.style.position = 'relative';MapControlDiv.style.backgroundImage = 'url(' + ESRI.ADF.System.blankImagePath + ')';MapControlDiv.id = 'MapControlDiv_' + this.get_id();var mapdiv = null;this.get_element().appendChild(MapControlDiv);if (Sys.Browser.agent !== Sys.Browser.InternetExplorer) {
MapControlDiv.style.MozUserFocus = 'normal';this._keyActionDiv = document.createElement('a');this._keyActionDiv.id = 'MapMozillaLink_' + this.get_id();this._keyActionDiv.style.MozUserFocus = 'normal';MapControlDiv.appendChild(this._keyActionDiv);$addHandler(this._keyActionDiv, 'mouseover', this._keyActionDiv.focus);mapdiv = this._keyActionDiv;}
else { mapdiv = MapControlDiv;}
this._containerDiv = document.createElement('div');this._containerDiv.style.width = '100%';this._containerDiv.style.height = '100%';this._containerDiv.style.position = 'relative';this._containerDiv.id = 'MapContainerDiv_' + this.get_id();this._containerDiv.style.left = '0';this._containerDiv.style.top = '0';this._containerDivPos = [0, 0];mapdiv.appendChild(this._containerDiv);this._layersDiv = this._createLayersDiv();this._containerDiv.appendChild(this._layersDiv);this._annotationDiv = document.createElement('div');this._annotationDiv.id = 'MapAnnotationDiv_' + this.get_id();this._containerDiv.appendChild(this._annotationDiv);this._annotationDiv.style.position = 'absolute';this._annotationDiv.style.left = '0';this._annotationDiv.style.top = '0';this._annotationDiv.dir = 'ltr';this._containerDiv.appendChild(this._annotationDiv);this._assotateCanvas = this._createCanvas(this._annotationDiv);this.get_element().style.MozUserSelect = 'none';if (Sys.Browser.agent === Sys.Browser.InternetExplorer) {
this.get_element().unselectable = 'on';}
else if (Sys.Browser.agent === Sys.Browser.Safari) {
this.get_element().style.KhtmlUserSelect = 'none';}
else {
this.get_element().style.MozUserSelect = 'none';this.get_element().style["-moz-user-focus"] = 'normal';}
this._tilesInView = {};this._requestStack = [];this._pendingSrcImages = [];this._mapsize = this._getInternalElementSize(this.get_element());this._assotateCanvas.adjustCanvasExtent(this._containerDivPos[0], this._containerDivPos[1], this._mapsize[1], this._mapsize[0]);if (this._progressBarEnabled) { this._createProgressBar();}
},
_createLayersDiv: function() {
var layersDiv = document.createElement('div');layersDiv.style.width = '100%';layersDiv.style.height = '100%';layersDiv.style.position = 'absolute';layersDiv.id = this.get_id() + '_layers';layersDiv.dir = 'ltr';this._layerReferences = {};return layersDiv;},
_createCanvas: function(vectorcanvas) {
vectorcanvas.style.position = 'absolute';vectorcanvas.style.width = '100%';vectorcanvas.style.height = '100%';vectorcanvas.style.overflow = 'visible';var map = this;var vectorCanvasObj = ESRI.ADF.Graphics.createCanvas(vectorcanvas, function(pnt) { return map._toMapScreen(pnt);});if (vectorCanvasObj) { vectorCanvasObj.initialize();}
return vectorCanvasObj;},
refresh: function() {
this._loadLayersInView();},
_clearImageTiles: function() {
this._clearRequestStack();this._tilesInView = {};var imgs = null;if (this._layersDiv.querySelectorAll) {
imgs = this._layersDiv.querySelectorAll('.esriMapImage');}
else { imgs = this._layersDiv.getElementsByTagName('img');}
for (var idx = 0;idx < imgs.length;idx++) { this._removeElement(imgs[idx]);}
this._layersDiv.innerHTML = '';this._layerReferences = {};var ext = this.get_extent();this._gridOrigin = new ESRI.ADF.Geometries.Point(ext.get_xmin(), ext.get_ymax());this._extent = null;this._containerDiv.style.left = 0;this._containerDiv.style.top = 0;this._containerDivPos = [0, 0];this._raiseEvent('gridOriginChanged', this._gridOrigin);},
_clearOldImageTiles: function() {
if (!this._oldLayersDiv) { return;}
this._oldLayersDiv.style.display = 'none';var imgs = null;if (this._oldLayersDiv.querySelectorAll) {
imgs = this._oldLayersDiv.querySelectorAll('.esriMapImage');}
else { imgs = this._oldLayersDiv.getElementsByTagName('img');}
for (var idx = 0;idx < imgs.length;idx++) { this._removeElement(imgs[idx]);}
imgs = null;this._removeElement(this._oldLayersDiv);this._oldLayersDiv = null;},
_clearResourceImageTiles: function(resource) {
var layerid = this._getLayerId(resource);var idx = 0;for (idx = this._requestStack.length - 1;idx >= 0;idx--) {
if (this._requestStack[idx].startsWith(layerid)) {
this._tilesInView[this._requestStack[idx]] = null;}
}
for (idx in this._tilesInView) {
if (idx != null && idx.startsWith(layerid)) {
this._tilesInView[idx] = null;}
}
var layer = this._layerReferences[layerid]
if (layer) {
var imgs = null;if (layer.querySelectorAll) {
imgs = layer.querySelectorAll('.esriMapImage');}
else { imgs = layer.getElementsByTagName('img');}
for (idx = imgs.length - 1;idx >= 0;idx--) { this._removeElement(imgs[idx]);}
layer.innerHTML = '';}
},
refreshLayer: function(layer) {
this._clearResourceImageTiles(layer);this._updateLayer(layer);},
_updateLayer: function(resource) {
if (!resource || !resource.get_isInitialized()) { return;}
var layerid = this._getLayerId(resource);var layer = this._layerReferences[layerid]
if (!resource.get_visible()) {
if (layer) { this._removeElement(layer);}
layer = null;this._layerReferences[layerid] = null;return;}
if (!layer) { layer = this._createLayerDiv(resource);}
if (ESRI.ADF.Layers.DynamicLayer.isInstanceOfType(resource)) {
var ext = this.get_extent();if (!resource.get_useTiling()) {
if (!ext.intersects(resource.get_extent())) { if (layer) { this._layerReferences[layerid] = null;this._removeElement(layer);} return;}
this._loadImageInView(layerid, ext, resource);}
else {
if (!ext.intersects(resource.get_extent())) { return;}
this._loadDynamicTilesInView(resource, layerid);}
}
else if (ESRI.ADF.Layers.TileLayer.isInstanceOfType(resource)) {
this._loadResourceTilesInView(resource, layer);}
},
_loadLayersInView: function() {
if (!this.get_isInitialized()) { return;}
this.checkMapsize(true);if (this._mapsize[0] === 0 || this._mapsize[1] === 0) {
return;}
this._assotateCanvas.adjustCanvasExtent(this._containerDivPos[0], this._containerDivPos[1], this._mapsize[1], this._mapsize[0]);if (this.get_layers().get_layerCount() > 0) {
if (this.disabled) { return;}
var ext = this.get_extent();if (ext.get_area() === 0) { return;}
var level = this.get_layers().getLevelByNearestPixelsize(this._pixelsizeX);if (level !== null) {
var resX = this.get_layers().get_levelResolution(level);if (this._pixelsizeX !== resX) { 
this._suppressExtentChanged = true;this.zoom(this._pixelsizeX / resX, null, false);this._suppressExtentChanged = false;}
}
for (var idx = 0;idx < this._layers.get_layerCount();idx++) {
var resource = this._layers.get_layer(idx);this._updateLayer(resource);}
}
this.refreshGraphics();},
_createLayerDiv: function(resource) {
var index = this._layers.indexOf(resource);if (index < 0) return null;var layer = document.createElement('div');layer.id = this._getLayerId(resource);layer.style.position = 'absolute';layer.style.left = 0;layer.style.top = 0;layer.resourceName = resource.get_id();this._layerReferences[layer.id] = layer;var layerNodes = this._layersDiv.childNodes;var length = layerNodes.length;var nodeInserted = false;for (var i = 0;i < length;i++) {
var node = layerNodes[i];var name = node.resourceName;if (!name) { continue;}
var res = $find(name);if (!res) { continue;}
var idx = this._layers.indexOf(res);if (idx > index) {
this._layersDiv.insertBefore(layer, node);nodeInserted = true;break;}
}
if (!nodeInserted) { this._layersDiv.appendChild(layer);}
if (Sys.Browser.agent !== Sys.Browser.InternetExplorer && resource.get_opacity() < 1 && resource.get_imageFormat() !== 'png32') {
ESRI.ADF.System.setOpacity(layer, resource.get_opacity());}
return layer;},
_loadImageInView: function(layerid, ext, resource) {
var ext2 = resource.get_extent();if (this._rotation.angle === 0) {
var w = this._clipExtentBuffer * this._pixelsizeX;var h = this._clipExtentBuffer * this._pixelsizeY;ext2 = new ESRI.ADF.Geometries.Envelope(ext2.get_xmin() - w, ext2.get_ymin() - h, ext2.get_xmax() + w, ext2.get_ymax() + h);ext2 = ext.intersection(ext2);}
else { ext2 = ext;}
var width = this._mapsize[0];var height = this._mapsize[1];width = Math.round(width * (ext2.get_width() / ext.get_width()));height = Math.round(height * (ext2.get_height() / ext.get_height()));ext2.set_xmax(ext2.get_xmin() + width * this._pixelsizeX);ext2.set_ymax(ext2.get_ymin() + height * this._pixelsizeY);var id = layerid + '_img';this._removePendingStackStartingWith(id, true, true);if (!this._dynamicImageCounter) { this._dynamicImageCounter = 0;}
id += this._dynamicImageCounter;this._dynamicImageCounter++;this._addPendingStack(id);var format = resource.get_imageFormat();var onready = function(url, adjExtent) {
this._addImageOnReady(layerid, ext2, url, resource.get_opacity(), id, format, false);onready = null;};var del = Function.createDelegate(this, onready);resource.getUrl(ext2.get_xmin(), ext2.get_ymin(), ext2.get_xmax(), ext2.get_ymax(), width, height, del);},
_loadTilesInView: function() {
for (var idx = 0;idx < this._layers.get_layerCount();idx++) {
var resource = this._layers.get_layer(idx);if (resource && resource.get_isInitialized() && resource._visible) {
if (ESRI.ADF.Layers.TileLayer.isInstanceOfType(resource)) {
var layerid = this._getLayerId(resource);var layer = this._layerReferences[layerid]
if (!layer) { layer = this._createLayerDiv(resource);}
this._loadResourceTilesInView(resource, layer, idx === 0);layer = null;}
else if (ESRI.ADF.Layers.DynamicLayer.isInstanceOfType(resource) && resource.get_useTiling()) {
var dynlayerid = this._getLayerId(resource);var dynlayer = this._layerReferences[dynlayerid]
if (!dynlayer) { dynlayer = this._createLayerDiv(resource);}
this._loadDynamicTilesInView(resource, dynlayerid, idx === 0);dynlayer = null;}
}
}
},
_loadDynamicTilesInView: function(resource, layerid) {
var tiles = this._getDynamicTiles(resource, this.get_extent());for (var idx in tiles) {
this._addDynamicTile(tiles[idx], layerid, resource);}
},
_getDynamicTiles: function(resource, ext) {
var tilesize = resource.get_tilesize();if (!tilesize) {
if (!this._dynTileSize || this._dynTileSize[0] == 0 || this._dynTileSize[1] == 0) {
this._dynTileSize = this._mapsize;if (this._dynTileSize[0] > 1024) { this._dynTileSize[0] = 1024;}
if (this._dynTileSize[1] > 1024) { this._dynTileSize[1] = 1024;}
}
tilesize = this._dynTileSize;}
var tiles = {};if (tilesize[0] > 0 && tilesize[1] > 0) {
var tilesizeMap = [tilesize[0] * this._pixelsizeX, tilesize[1] * this._pixelsizeY];var startcol = Math.floor((ext.get_xmin() - this._gridOrigin.coordinates[0]) / tilesizeMap[0]);var startrow = Math.floor((this._gridOrigin.coordinates[1] - ext.get_ymax()) / tilesizeMap[1]);var endcol = Math.floor((ext.get_xmax() - this._gridOrigin.coordinates[0] - this._pixelsizeX * 0.5) / tilesizeMap[0]);var endrow = Math.floor((this._gridOrigin.coordinates[1] - ext.get_ymin() - this._pixelsizeY * 0.5) / tilesizeMap[1]);var idx = 0;for (var row = startrow;row <= endrow;row++) {
var top = this._gridOrigin.coordinates[1] - row * tilesizeMap[1];for (var col = startcol;col <= endcol;col++) {
var left = this._gridOrigin.coordinates[0] + col * tilesizeMap[0];tiles[idx] = { "env": [left, top - tilesizeMap[1], left + tilesizeMap[0], top], "row": row, "col": col, "width": tilesize[0], "height": tilesize[1] };idx++;}
}
}
return tiles;},
_loadResourceTilesInView: function(resource, layer) {
if (resource.get_minimumResolution() < this._pixelsizeX - this._pixelsizeX/256 ||
resource.get_maximumResolution() > this._pixelsizeX + this._pixelsizeX/256) { return;}
var currentLevel = resource.getLevelByNearestPixelsize(this._pixelsizeX);var res = resource.get_levels()[currentLevel].get_resX();var lod = this._pixelsizeX;if (!this._layers._resolutionsAreSame(lod, res)) { return;}
if (currentLevel !== null) { lod = resource.getLevelInfo(currentLevel).get_resX();}
if (lod) {
var tiles = resource.getTileSpanWithin(this.get_extent(), currentLevel);for (var column = tiles[0];column <= tiles[2];column++) {
for (var row = tiles[1];row <= tiles[3];row++) {
this._addTile(column, row, currentLevel, layer, resource);}
}
}
},
_isTileInPendingStack: function(id) {
return Array.contains(this._requestStack, id);},
_clearRequestStack: function() {
if (this._requestStack) {
var elm = null;var img = null;var parent = null;while (this._requestStack.length > 0) {
elm = Array.dequeue(this._requestStack);img = $get(elm);if (img) {
parent = img.parentNode;this._removeElement(img);if (ESRI.ADF.System.__isIE6 && parent) { this._removeElement(parent);}
}
}
}
else { this._requestStack = [];}
this._raiseEvent('onProgress', 0);},
_addPendingStack: function(id) {
Array.add(this._requestStack, id);this._raiseEvent('onProgress', this._requestStack.length);},
_removePendingStack: function(id, removeImg, suppressEvent) {
if (removeImg === true) {
var img = $get(id);if (img) {
var parent = img.parentNode;this._removeElement(img);if (ESRI.ADF.System.__isIE6 && parent) { this._removeElement(parent);}
}
}
if (Array.contains(this._requestStack, id)) {
Array.remove(this._requestStack, id);if (!suppressEvent) { this._raiseEvent('onProgress', this._requestStack.length);}
if (this._requestStack.length === 0 && this._oldLayersDiv) { this._clearOldImageTiles();}
}
},
_removePendingStackStartingWith: function(id, removeImg, suppressEvent) {
Array.forEach(this._requestStack, function(imgid, index, arr) { if (imgid.startsWith(id)) { this._removePendingStack(imgid, removeImg, suppressEvent);} }, this);},
_removeOutsideTiles: function() {
var tilesToKeep = [];for (var resourceIndex = 0;resourceIndex < this.get_layers().get_layerCount();resourceIndex++) {
var resource = this.get_layers().get_layer(resourceIndex);if (resource && resource.get_visible() === true) {
var extent = this.get_extent();if (this._tileBuffer === null || typeof (this._tileBuffer) == 'undefined' || this._tileBuffer < 0) {
bufferWidth = extent.get_width();bufferHeight = extent.get_height();}
else { bufferWidth = bufferHeight = this._tileBuffer * this._pixelsizeX;}
extent.set_xmin(extent.get_xmin() - bufferWidth);extent.set_xmax(extent.get_xmax() + bufferWidth);extent.set_ymin(extent.get_ymin() - bufferHeight);extent.set_ymax(extent.get_ymax() + bufferHeight);if (ESRI.ADF.Layers.TileLayer.isInstanceOfType(resource)) {
var currentLevel = resource.getLevelByNearestPixelsize(this._pixelsizeX);var res = resource.get_levels()[currentLevel].get_resX();var lod = this._pixelsizeX;if (!this._layers._resolutionsAreSame(lod, res)) { continue;}
var tiles = resource.getTileSpanWithin(extent, currentLevel);for (var column = tiles[0];column <= tiles[2];column++) {
for (var row = tiles[1];row <= tiles[3];row++) {
Array.add(tilesToKeep, this._getTileId(resource, row, column, currentLevel));}
}
}
else if (ESRI.ADF.Layers.DynamicLayer.isInstanceOfType(resource) && resource.get_useTiling()) {
var tiles2 = this._getDynamicTiles(resource, extent);for (var idx in tiles2) {
Array.add(tilesToKeep, this._getTileId(resource, tiles2[idx].row, tiles2[idx].col, this._pixelsizeX));}
}
}
}
for (var id in this._tilesInView) {
if (id && !Array.contains(tilesToKeep, id)) {
this._removePendingStack(id, true);this._tilesInView[id] = null;}
}
},
_getTileId: function(resource, row, column, level) {
return this._getLayerId(resource) + '_r' + row + 'c' + column + 'l' + level;},
_getLayerId: function(resource) {
return this._layersDiv.id + '_' + resource.get_id();},
_removeElement: function(element) {
if (!element) { return;}
$clearHandlers(element);var garbageBin = $get('IELeakGarbageBin');if (!garbageBin) {
garbageBin = document.createElement('DIV');garbageBin.id = 'IELeakGarbageBin';garbageBin.style.display = 'none';document.body.appendChild(garbageBin);}
garbageBin.appendChild(element);if (element.tagName === 'img' || element.tagName === 'IMG') { element.removeAttribute('src');}
garbageBin.innerHTML = '';},
_addTile: function(column, row, currentLevel, layer, resource) {
var tileid = this._getTileId(resource, row, column, currentLevel);if (!this._tilesInView[tileid]) {
this._tilesInView[tileid] = true;var tileEnv = resource.getTileExtent(column, row, currentLevel);this._addPendingStack(tileid);var format = resource.get_imageFormat();var handler = Function.createDelegate(this, function(url) { this._addTileOnReady(tileid, tileEnv, resource.get_opacity(), layer, url, format);handler = null;});resource.getTileUrl(column, row, currentLevel, handler);}
},
_addDynamicTile: function(tile, layerid, resource) {
var tileid = this._getTileId(resource, tile.row, tile.col, this._pixelsizeX);if (!this._tilesInView[tileid]) {
var tileEnv = new ESRI.ADF.Geometries.Envelope(tile.env[0], tile.env[1], tile.env[2], tile.env[3]);if (!resource.get_extent().intersects(tileEnv)) { return;}
this._tilesInView[tileid] = true;this._addPendingStack(tileid);var format = resource.get_imageFormat();var handler = Function.createDelegate(this, function(url) {
this._addImageOnReady(layerid, tileEnv, url, resource.get_opacity(), tileid, format, true);handler = null;});resource.getUrl(tile.env[0], tile.env[1], tile.env[2], tile.env[3], tile.width, tile.height, handler);}
},
_addTileOnReady: function(tileid, tileEnv, opacity, layer, url, format) {
var img = new Image();var container = null;var upperLeft = this._toMapScreen(new ESRI.ADF.Geometries.Point(tileEnv.get_xmin(), tileEnv.get_ymax()));var bottomRight = this._toMapScreen(new ESRI.ADF.Geometries.Point(tileEnv.get_xmax(), tileEnv.get_ymin()));var width = bottomRight.offsetX - upperLeft.offsetX;var height = bottomRight.offsetY - upperLeft.offsetY;if (ESRI.ADF.System.__isIE6) {
container = document.createElement('div');container.className = 'esriMapImage';container.appendChild(img);container.style.width = width + 'px';container.style.height = height + 'px';img.format = format;img.style.width = '100%';img.style.height = '100%';}
else {
img.className = 'esriMapImage';img.style.width = width + 'px';img.style.height = height + 'px';container = img;}
container.style.position = 'absolute';container.style.left = upperLeft.offsetX + 'px';container.style.top = upperLeft.offsetY + 'px';img.id = tileid;if (!this._fncTileOnLoad) {
this._fncTileOnLoad = function(e) {
var img = e.target;if (Sys.Browser.agent === Sys.Browser.Firefox) {
img = e.rawEvent.currentTarget;}
if (!this._isTileInPendingStack(img.id)) {
this._removeElement(img);return;}
this._removePendingStack(img.id, false);$clearHandlers(img);img.onerror = null;img.style.display = 'block';if (ESRI.ADF.System.__isIE6 && img.format.startsWith('png')) { ESRI.ADF.System.setIEPngTransparency(img, img.src);}
img = null;if (Sys.Browser.agent === Sys.Browser.InternetExplorer && !this._fadingStarted && this._animationSettings.enableFadeTransition && !this._animationSettings.disableNavigationAnimation) {
this._fadingStarted = true;if (this._layersDiv.filters[0]) {
this._layersDiv.filters[0].Play();window.setTimeout(Function.createDelegate(this, function() { this._layersDiv.style.filter = '';}), 500);}
}
};}
if (!this._fncTileOnError) {
this._fncTileOnError = Function.createDelegate(this, function(e) {
var img = null;if (!e) e = window.event;if (e.srcElement) {
img = window.event.srcElement;}
else if (e.currentTarget) {
img = e.currentTarget;}
if (!img) { return;}
img.onerror = null;$clearHandlers(img);Sys.Debug.trace('Failure loading tile "' + img.id + '" from ' + img.src);this._removeElement(img);if (!this._isTileInPendingStack(img.id)) { return;}
this._removePendingStack(img.id, true);img = null;});}
$addHandlers(img, { 'load': this._fncTileOnLoad }, this);img.onerror = this._fncTileOnError;if (Sys.Browser.agent !== Sys.Browser.InternetExplorer) { img.style.display = 'none';}
else if (opacity < 1 && format !== 'png32') { ESRI.ADF.System.setOpacity(container, opacity);}
layer.appendChild(container);img.src = url;img = null;container = null;},
_addImageOnReady: function(layerid, extent, url, opacity, id, format, keepOld) {
if (!this._isTileInPendingStack(id)) { return;}
if (!url || url === '') { 
this._removePendingStack(id, false);return;}
var layer = this._layerReferences[layerid]
if (!layer) { this._removePendingStack(id, false);return;}
if (Array.contains(this._pendingSrcImages, id)) {
var img2 = $get(id);if (img2) {
var parent = img2.parentNode;this._removeElement(img2);if (ESRI.ADF.System.__isIE6) {
this._removeElement(parent);}
}
img2 = null;}
else {
Array.add(this._pendingSrcImages, id);}
var currentImage = $get(id);if (currentImage && !keepOld) { currentImage.id += '_old';}
var img = new Image();img.id = id;img.alt = '';if (Sys.Browser.agent === Sys.Browser.Safari) {
img.style.KhtmlUserSelect = 'none';img.onmousedown = function() { return false;}
}
var container = null;if (ESRI.ADF.System.__isIE6) {
container = document.createElement('div');container.className = 'esriMapImage';container.appendChild(img);container.style.width = Math.round(extent.get_width() / this._pixelsizeX) + 'px';container.style.height = Math.round(extent.get_height() / this._pixelsizeY) + 'px';img.format = format;img.style.width = '100%';img.style.height = '100%';}
else {
img.className = 'esriMapImage';img.style.width = Math.round(extent.get_width() / this._pixelsizeX) + 'px';img.style.height = Math.round(extent.get_height() / this._pixelsizeY) + 'px';container = img;}
var upperLeft = new ESRI.ADF.Geometries.Point(extent.get_xmin(), extent.get_ymax());var imgpos = this._toMapScreen(upperLeft);container.style.position = 'absolute';if (this._rotation.angle === 0) {
container.style.left = imgpos.offsetX + 'px';container.style.top = imgpos.offsetY + 'px';}
else {
container.style.left = -this._containerDivPos[0] + 'px';container.style.top = -this._containerDivPos[1] + 'px';}
if (!this._fncImageOnLoad) {
this._fncImageOnLoad = Function.createDelegate(this, this._onImageTileLoaded);}
if (keepOld) { img.keepOld = 'true';}
else { img.keepOld = 'false';}
$addHandler(img, 'load', this._fncImageOnLoad);if (Sys.Browser.agent !== Sys.Browser.InternetExplorer) { img.style.display = 'none';}
else if (opacity < 1 && format !== 'png32') {
ESRI.ADF.System.setOpacity(img, opacity);}
layer.appendChild(container);img.src = url;img = null;container = null;},
_onImageTileLoaded: function(e) {
var img = e.target;Array.remove(this._pendingSrcImages, img.id);if (Sys.Browser.agent === Sys.Browser.Firefox) { img = e.rawEvent.currentTarget;}
$clearHandlers(img);if (!this._isTileInPendingStack(img.id)) {
this._tilesInView[img.id] = null;var parent = img.parentNode;this._removeElement(img);if (ESRI.ADF.System.__isIE6) { this._removeElement(parent);}
return;}
this._removePendingStack(img.id, false);var layer = img.parentNode;if (ESRI.ADF.System.__isIE6) { layer = layer.parentNode;}
if (img.keepOld !== 'true') {
var imgs = null;if (layer.querySelectorAll) {
imgs = layer.querySelectorAll('.esriMapImage');}
else { imgs = layer.getElementsByTagName('img');}
for (var idx = imgs.length - 1;idx >= 0;idx--) {
if (imgs[idx].id !== img.id) {
if (ESRI.ADF.System.__isIE6) {
var prnode = imgs[idx].parentNode;this._removeElement(imgs[idx]);this._removeElement(prnode);}
else { this._removeElement(imgs[idx]);}
}
}
}
if (Sys.Browser.agent === Sys.Browser.InternetExplorer && !this._fadingStarted && this._animationSettings.enableFadeTransition && !this._animationSettings.disableNavigationAnimation) {
this._fadingStarted = true;if (this._layersDiv.filters && this._layersDiv.filters[0]) {
this._layersDiv.filters[0].Play();window.setTimeout(Function.createDelegate(this, function() { this._layersDiv.style.filter = '';}), 500);}
}
if (ESRI.ADF.System.__isIE6 && img.format.startsWith('png')) { ESRI.ADF.System.setIEPngTransparency(img, img.src, false, img.format);}
img.style.display = 'block';img = null;},
_makeMouseEventRelativeToMap: function(e, resetLocation) {
if (!this._controlDivLocation || resetLocation) { this._controlDivLocation = Sys.UI.DomElement.getLocation(this._controlDiv);}
e = ESRI.ADF.System._makeMouseEventRelativeToElement(e, this._controlDiv, this._controlDivLocation);e.coordinate = this.toMapPoint(e.offsetX, e.offsetY);return e;},
_raiseEvent: function(name, e) {
if (!this.get_isInitialized()) { return;}
var handler = this.get_events().getHandler(name);if (handler) { if (e === null || typeof (e) === 'undefined') { e = Sys.EventArgs.Empty;} handler(this, e);}
},
_hookEventsOnMouseEnter: function(e) {
if (this._mouseInsideViewer === true) { return;}
if (Sys.Browser.agent !== Sys.Browser.InternetExplorer && e && (this._isZooming || !this._isMouseEnter(e.rawEvent, this.get_element()))) {
return;}
this._mouseInsideViewer = true;if (this._mouseDragState) { return;} 
if (!this._mapActiveEventsAttached) {
this._mapActiveEventsAttached = true;ESRI.ADF.UI.__DomEvent.__addHandler((Sys.Browser.agent === Sys.Browser.InternetExplorer) ? document.body : window, 'mousemove', this._mouseMoveHandler);$addHandler(document, 'keydown', this._onKeyDownHandler);$addHandler(document, 'keyup', this._onKeyUpHandler);}
this._raiseEvent('mouseOver', e);},
_unhookEventsOnMouseLeave: function(e) {
if (Sys.Browser.agent !== Sys.Browser.InternetExplorer && e && (this._isZooming || !this._isMouseLeave(e.rawEvent, this.get_element()))) {
return;}
this._mouseInsideViewer = false;if (this._mouseDragState) { return;} 
this._raiseEvent('mouseOut', e);if (this._mapActiveEventsAttached) {
$removeHandler((Sys.Browser.agent === Sys.Browser.InternetExplorer) ? document.body : window, 'mousemove', this._mouseMoveHandler);$removeHandler(document, 'keydown', this._onKeyDownHandler);$removeHandler(document, 'keyup', this._onKeyUpHandler);this._mapActiveEventsAttached = false;}
},
_isMouseEnter: function(e, handler) {
if (e.type !== 'mouseover') return false;var reltg = e.relatedTarget ? e.relatedTarget : e.fromElement;while (reltg && reltg !== handler) reltg = reltg.parentNode;return (reltg !== handler);},
_isMouseLeave: function(e, handler) {
if (e.type !== 'mouseout') return false;var reltg = e.relatedTarget ? e.relatedTarget : e.toElement;while (reltg && reltg !== handler) reltg = reltg.parentNode;return (reltg !== handler);},
_onMouseMove: function(evt) {
var e = this._makeMouseEventRelativeToMap(evt, false);this._raiseEvent('mouseMove', e);if (this._mouseDragState) {
if (this._mouseDragState.button === e.button && this._mouseDragState.mousedownX && this._mouseDragState.mousedownY &&
this._mouseDragState.button === Sys.UI.MouseButton.leftButton) {
e.originX = this._mouseDragState.mousedownX;e.originY = this._mouseDragState.mousedownY;e.deltaX = e.offsetX - this._mouseDragState.mousedownX;e.deltaY = e.offsetY - this._mouseDragState.mousedownY;e.mousedownCoordinate = this._mouseDragState.mousedownCoordinate;this._raiseEvent('mouseDragging', e);evt.preventDefault();evt.stopPropagation();}
this._mouseDragState.previousOffsetX = e.offsetX;this._mouseDragState.previousOffsetY = e.offsetY;}
},
_onMouseDown: function(e) {
e = this._makeMouseEventRelativeToMap(e, true);if (!this._mapActiveEventsAttached) { this._hookEventsOnMouseEnter();}
if (!this._mouseUpEventAttached) {
ESRI.ADF.UI.__DomEvent.__addHandler((Sys.Browser.agent === Sys.Browser.InternetExplorer) ? document.body : window, 'mouseup', this._mouseUpHandler);this._mouseUpEventAttached = true;}
if (!this._isZooming) {
this._mouseDragState = {
"mousedownX": e.offsetX, "mousedownY": e.offsetY,
"previousOffsetX": e.offsetX, "previousOffsetY": e.offsetY,
"button": e.button, "mousedownCoordinate": e.coordinate,
"startExtent": this.get_extent()
};}
this._raiseEvent('mouseDown', e);},
_onMouseUp: function(evt) {
var e = this._makeMouseEventRelativeToMap(evt, true);this._raiseEvent('mouseUp', e);if (this._mouseDragState && this._mouseDragState.button === e.button) {
if (this._mouseUpEventAttached) {
$removeHandler((Sys.Browser.agent === Sys.Browser.InternetExplorer) ? document.body : window, 'mouseup', this._mouseUpHandler);this._mouseUpEventAttached = false;}
this._controlDivLocation = null;if (this._mouseDragState.mousedownX && this._mouseDragState.mousedownY &&
(this._mouseDragState.mousedownX !== e.offsetX || this._mouseDragState.mousedownY !== e.offsetY)) {
e.originX = this._mouseDragState.mousedownX;e.originY = this._mouseDragState.mousedownY;e.deltaX = e.offsetX - this._mouseDragState.mousedownX;e.deltaY = e.offsetY - this._mouseDragState.mousedownY;e.mousedownCoordinate = this._mouseDragState.mousedownCoordinate;e.mouseStartExtent = this._mouseDragState.startExtent;this._mouseDragState = null;if (!this._mouseInsideViewer) {
this._unhookEventsOnMouseLeave();}
this._raiseEvent('mouseDragCompleted', e);}
else if (this._mouseDragState.mousedownX && this._mouseDragState.mousedownY &&
(this._mouseDragState.mousedownX === e.offsetX || this._mouseDragState.mousedownY === e.offsetY)) {
this._mouseDragState = null;this._raiseEvent('click', e);}
}
evt.preventDefault();evt.stopPropagation();},
_onMouseWheel: function(e) {
this._mouseDragState = null;if (e.target.namespaceURI && e.target.namespaceURI === 'http://www.w3.org/2000/svg') {
e.offsetX += parseInt(this._assotateCanvas._svgRoot.style.left, 10);e.offsetY += parseInt(this._assotateCanvas._svgRoot.style.top, 10);e.target = this._assotateCanvas._svgRoot.parentNode;}
e = this._makeMouseEventRelativeToMap(e, true);var now = new Date();if (!this._lastScrollZoomDate || (now - this._lastScrollZoomDate) > 150) {
if (Sys.Browser.agent === Sys.Browser.InternetExplorer && this._animationSettings.enableFadeTransition && !this._animationSettings.disableNavigationAnimation && this._layersDiv.filters[0] && this._layersDiv.filters[0].status === 1) {
return;}
this.zoom(this._getZoomFactor(e.wheelDelta * this._mouseWheelDirection > 0), e.coordinate);this._lastScrollZoomDate = now;}
},
_onDblClick: function(e) {
e.preventDefault();e.stopPropagation();e = this._makeMouseEventRelativeToMap(e, true);if (this._mouseMode !== ESRI.ADF.UI.MouseMode.Custom) { this.zoom(this._getZoomFactor(true), e.coordinate);}
this._raiseEvent('dblclick', e);},
_onClick: function(s, e) {
if (e.button === Sys.UI.MouseButton.leftButton) {
if (this._mouseMode === ESRI.ADF.UI.MouseMode.ZoomIn) { this.zoom(this._getZoomFactor(true), e.coordinate);}
else if (this._mouseMode === ESRI.ADF.UI.MouseMode.ZoomOut) { this.zoom(this._getZoomFactor(false), e.coordinate);}
}
},
_getZoomFactor: function(zoomin) {
if (!this._layers.__hasLevels()) { return (zoomin ? 2 : 0.5);}
else {
var level = this._layers.getLevelByNearestPixelsize(this._pixelsizeX);var level2Res = this._layers.get_levelResolution(level + (zoomin ? 1 : -1));if (!level2Res) { return 1;}
else { return this._pixelsizeX / level2Res;}
}
},
_onKeyDown: function(eventArgs) {
this._raiseEvent('keyDown', eventArgs);if (this._keyActions[eventArgs.keyCode]) {
this._fireKeyDownAction(this._keyActions[eventArgs.keyCode]);return;}
},
_onKeyUp: function(eventArgs) {
this._raiseEvent('keyUp', eventArgs);if (this._keyActions[eventArgs.keyCode]) {
this._fireKeyUpAction(this._keyActions[eventArgs.keyCode]);return;}
},
_fireKeyDownAction: function(keyaction) {
if (!this._currentKeyActions) { this._currentKeyActions = [];}
var isactive = Array.contains(this._currentKeyActions, keyaction);if (isactive && !keyaction.continuous) { return;}
if (!isactive) { Array.add(this._currentKeyActions, keyaction);}
if (keyaction.cursor) { this.get_element().style.cursor = keyaction.cursor;}
keyaction.keydown();},
_fireKeyUpAction: function(keyaction) {
if (keyaction === 'all' && this._currentKeyActions) {
for (var idx = 0;idx < this._currentKeyActions.length;idx++) {
if (keyaction.keyup) { this._currentKeyActions[idx].keyup();}
}
this._currentKeyActions = [];if (keyaction.cursor) { this.get_element().style.cursor = this.get_cursor();}
return;}
if (!this._currentKeyActions || !Array.contains(this._currentKeyActions, keyaction)) { return;}
if (keyaction.cursor) { this.get_element().style.cursor = this.get_cursor();}
Array.remove(this._currentKeyActions, keyaction);if (keyaction.keyup) { keyaction.keyup();}
},
_doContinuousPan: function(x, y) {
if (!this._tmpKeyPanExtent) { this._tmpKeyPanExtent = this.get_extent();}
if (!x && !y) { this._raiseEvent('panCompleted', { "previous": this._tmpKeyPanExtent, "current": this.get_extent() });this._tmpKeyPanExtent = null;return;}
this._moveContainerDiv(x, y);this._raiseEvent('panning');},
_onMouseDragging: function(sender, args) {
if (this._mouseMode === ESRI.ADF.UI.MouseMode.Pan) {
this._onMapPanDragging(sender, args);}
else if (this._mouseMode === ESRI.ADF.UI.MouseMode.ZoomIn || this._mouseMode === ESRI.ADF.UI.MouseMode.ZoomOut) {
if (!this._tempDragBox) {
this._tempDragBox = document.createElement('div');this._tempDragBox.style.border = 'solid 2px #333333';this._tempDragBox.style.backgroundColor = '#ffffff';this._tempDragBox.style.position = 'absolute';ESRI.ADF.System.setOpacity(this._tempDragBox, 0.5);}
this._getEnvelopeDraggingHandler(sender, args);}
},
_onMouseDragCompleted: function(sender, args) {
if (this._mouseMode === ESRI.ADF.UI.MouseMode.Pan) {
this._onMapPanDragCompleted(sender, args);}
else if (this._mouseMode === ESRI.ADF.UI.MouseMode.ZoomIn || this._mouseMode === ESRI.ADF.UI.MouseMode.ZoomOut) {
this._getEnvelopeComplete(sender, args);}
},
_moveContainerDiv: function(x, y) {
this._containerDivPos[0] -= x;this._containerDivPos[1] -= y;this._containerDiv.style.left = this._containerDivPos[0] + 'px';this._containerDiv.style.top = this._containerDivPos[1] + 'px';if (this._extent) {
this._extent._xmin += x * this._pixelsizeX;this._extent._xmax += x * this._pixelsizeX;this._extent._ymin -= y * this._pixelsizeY;this._extent._ymax -= y * this._pixelsizeY;}
},
_onMapPanDragging: function(sender, e) {
this._moveContainerDiv((this._mouseDragState.previousOffsetX - e.offsetX), (this._mouseDragState.previousOffsetY - e.offsetY));e.originX = this._mouseDragState.mousedownX;e.originY = this._mouseDragState.mousedownY;this._isPanning = true;this._raiseEvent('panning');},
_onMapPanDragCompleted: function(sender, args) {
this._isPanning = false;this._extent = null;this._raiseEvent('panCompleted', { "previous": args.mouseStartExtent, "current": this.get_extent() });},
_getEnvelopeDraggingHandler: function(sender, args) {
if (!this._tempDragBox.parentNode) { this._containerDiv.appendChild(this._tempDragBox);}
var from = this._toMapScreen(args.mousedownCoordinate);var to = this._toMapScreen(args.coordinate);var border = parseInt(this._tempDragBox.style.borderWidth, 10);var width = Math.abs(from.offsetX - to.offsetX) - border * 2 + (from.offsetX < to.offsetX ? 1 : 0);var height = Math.abs(from.offsetY - to.offsetY) - border * 2 + (from.offsetY < to.offsetY ? 1 : 0);if (width < 0) { width = 0;}
if (height < 0) { height = 0;}
this._tempDragBox.style.left = (from.offsetX < to.offsetX ? from.offsetX : to.offsetX) + 'px';this._tempDragBox.style.top = (from.offsetY < to.offsetY ? from.offsetY : to.offsetY) + 'px';this._tempDragBox.style.width = width + 'px';this._tempDragBox.style.height = height + 'px';},
_getEnvelopeComplete: function(sender, args) {
this._removeElement(this._tempDragBox);this._tempDragBox = null;var currentExtent = this.get_extent();var env = new ESRI.ADF.Geometries.Envelope(
Math.min(args.mousedownCoordinate.get_x(), args.coordinate.get_x()),
Math.min(args.mousedownCoordinate.get_y(), args.coordinate.get_y()),
Math.max(args.mousedownCoordinate.get_x(), args.coordinate.get_x()),
Math.max(args.mousedownCoordinate.get_y(), args.coordinate.get_y()), this._spatialReference);this._currentState = null;if (this._mouseMode === ESRI.ADF.UI.MouseMode.ZoomOut) {
var newWidth = currentExtent.get_width() * (currentExtent.get_width() / env.get_width());var newheight = currentExtent.get_height() * (currentExtent.get_height() / env.get_height());env.set_xmin(currentExtent.get_xmin() - ((env.get_xmin() - currentExtent.get_xmin()) * (currentExtent.get_width() / env.get_width())));env.set_ymin(currentExtent.get_ymin() - ((env.get_ymin() - currentExtent.get_ymin()) * (currentExtent.get_height() / env.get_height())));env.set_xmax(currentExtent.get_xmin() + newWidth);env.set_ymax(currentExtent.get_ymin() + newheight);}
var scaleFactor = currentExtent.get_width() / env.get_width();var toPx = this._pixelsizeX / scaleFactor;var toLevel = this.get_layers().getLevelByNearestPixelsize(toPx);if (toLevel !== null) { toPx = this.get_layers().get_levelResolution(toLevel);}
if (this._pixelsizeX === toPx) { return;} 
this.zoomToBox(env);},
_onZoomStep: function(anim, startScale, endScale, orgScale) {
this._extent = null;var ratio = this._pixelsizeY / this._pixelsizeX;this._recalculateContainerOffset();this._pixelsizeX = orgScale / anim.interpolate(startScale, endScale, anim.get_percentComplete());this._pixelsizeY = this._pixelsizeX * ratio;this._raiseEvent('extentChanging');},
_resetGridOffset: function() {
var ext = this.get_extent();this._clearImageTiles();this._gridOrigin = new ESRI.ADF.Geometries.Point(ext.get_xmin(), ext.get_ymax());this._extent = null;this._containerDivPos = [0, 0];this._containerDiv.style.left = 0;this._containerDiv.style.top = 0;this._raiseEvent('gridOriginChanged', this._gridOrigin);},
_onResize: function(e) {
if (Sys.Browser.agent === Sys.Browser.InternetExplorer) {
if (this._resizeTimer) { window.clearTimeout(this._resizeTimer);}
this._resizeTimer = window.setTimeout(Function.createDelegate(this, this._onResizeComplete), 1000);}
else { this._onResizeComplete();}
},
_onResizeComplete: function() {
this._resizeTimer = null;this.checkMapsize();},
checkMapsize: function(suppressEvent) {
var size = this._getInternalElementSize(this.get_element());if (this._mapsize[0] !== size[0] || this._mapsize[1] !== size[1]) {
this._tmpExtent = this.get_extent();this._mapsize = size;this._extent = null;this._controlDivLocation = null;this._raiseEvent('mapResized', size);if (this._rotation.angle !== 0) { this.refreshGraphics(true);}
if (!suppressEvent && this._suppressExtentChanged !== true) {
this._raiseEvent('extentChanged', { "previous": this._tmpExtent, "current": this.get_extent() });this._tmpExtent = null;}
}
},
_getInternalElementSize: function(elm) {
return [parseInt(elm.clientWidth, 10), parseInt(elm.clientHeight, 10)];},
_addExtentHistory: function(previousExt, currentExt) {
if (this._currentExtentHistory === -1) { return;}
if (this._currentExtentHistory !== null && this._currentExtentHistory + 1 < this._extentHistory.length) {
var len = this._extentHistory.length;for (var idx = this._currentExtentHistory + 1;idx < len;idx++) {
Array.removeAt(this._extentHistory, this._currentExtentHistory + 1);}
}
Array.add(this._extentHistory, this.get_extent());if (this._extentHistory.length > 50) { Array.dequeue(this._extentHistory);}
else { this._currentExtentHistory = this._extentHistory.length - 1;}
},
stepExtentHistory: function(steps) {
var pos = (this._currentExtentHistory !== null ? this._currentExtentHistory : this._extentHistory.length - 1) + steps;if (pos < 0) { pos = 0;}
else if (pos >= this._extentHistory.length - 1) { pos = this._extentHistory.length - 1;}
this._currentExtentHistory = -1;this.set_extent(this._extentHistory[pos]);this._currentExtentHistory = pos;return !(pos === 0 || pos === this._extentHistory.length - 1);},
_initializeZoomAnimation: function(scaleFactor, centerX, centerY) {
var duration = this._animationSettings.duration;var fps = this._animationSettings.fps;var animations = [];if (centerX === null || typeof (centerX) == "undefined") { centerX = parseInt(this.get_element().clientWidth, 10) * 0.5;}
if (centerY === null || typeof (centerY) == "undefined") { centerY = parseInt(this.get_element().clientHeight, 10) * 0.5;}
centerX -= this._containerDivPos[0];centerY -= this._containerDivPos[1];var moveanim = new AjaxControlToolkit.Animation.MoveAnimation(this._containerDiv, duration, fps, -centerX * (scaleFactor - 1), -centerY * (scaleFactor - 1), true);Array.add(animations, moveanim);var imgs = null;if (this._layersDiv.querySelectorAll) {
imgs = this._layersDiv.querySelectorAll('.esriMapImage');}
else { imgs = this._layersDiv.getElementsByTagName(ESRI.ADF.System.__isIE6 ? 'div' : 'img');}
for (var idx = 0;idx < imgs.length;idx++) {
var imgTile = imgs[idx];if (imgTile && imgTile.tagName && imgTile.tagName.toUpperCase() === (ESRI.ADF.System.__isIE6 ? 'DIV' : 'IMG')) {
var anim = new ESRI.ADF.Animations.ZoomAnimation(imgTile, duration, fps, scaleFactor, 0.0, 0.0);Array.add(animations, anim);}
}
return new ESRI.ADF.Animations.ParallelAnimation(null, duration, fps, animations);},
zoom: function(scaleFactor, center, animate) {
if (this._isZooming) {
if (!this._zoomQueue) { this._zoomQueue = [];}
Array.add(this._zoomQueue, { "scaleFactor": scaleFactor, "center": center });return;}
this._clearOldImageTiles();if (!center) { center = this.get_extent().get_center();}
if (animate !== false) { animate = true;}
var screenPoint = this.toScreenPoint(center);var centerOffsetX = screenPoint.offsetX;var centerOffsetY = screenPoint.offsetY;var fromPx = this._pixelsizeX;var toPx = this._pixelsizeX / scaleFactor;var toLevel = this.get_layers().getLevelByNearestPixelsize(toPx);if (toLevel !== null) { toPx = this.get_layers().get_levelResolution(toLevel);}
else {
if (this._minZoom && toPx < this._minZoom) { toPx = this._minZoom;}
else if (this._maxZoom && toPx > this._maxZoom) { toPx = this._maxZoom;}
}
scaleFactor = fromPx / toPx;if (animate && ESRI.ADF.System.__isIE6) {
var layers = this.get_layers();for (var i = 0;i < layers.get_layerCount();i++) {
var layer = layers.get_layer(i);if (layer.get_opacity() < 1 && (layer.get_imageFormat() === 'png8' || layer.get_imageFormat() === 'png24')) {
animate = false;break;}
}
}
if (scaleFactor === 1) { return false;}
else if (scaleFactor > 25) { animate = false;}
var anim = this._initializeZoomAnimation(scaleFactor, centerOffsetX, centerOffsetY);var startscale = this._pixelsizeX;var endextent = this.get_extent();var w0 = endextent.get_width();var h0 = endextent.get_height();var w1 = w0 / scaleFactor;var h1 = h0 / scaleFactor;var mx = center.get_x();var my = center.get_y();var mmx1 = -((w1 * 0.5) * (mx - endextent.get_xmin()) / (w0 * 0.5) - mx);var mmy1 = -((h1 * 0.5) * (my - endextent.get_ymin()) / (h0 * 0.5) - my);endextent.set_xmin(mmx1);endextent.set_xmax(mmx1 + w1);endextent.set_ymin(mmy1);endextent.set_ymax(mmy1 + h1);var onEnd = Function.createDelegate(this, function() {
this._pixelsizeX = toPx;this._pixelsizeY = this._pixelsizeX;this._recalculateContainerOffset();this._extent = endextent;anim.dispose();anim = null;onEnd = null;if (this._zoomQueue && this._zoomQueue.length > 0) {
var next = Array.dequeue(this._zoomQueue);this._isZooming = false;var result = this.zoom(next.scaleFactor, next.center, true);if (!result) { this._raiseEvent('zoomCompleted');}
}
else if (scaleFactor !== 1) { this._raiseEvent('zoomCompleted');}
});if (animate && !this.get_disableNavigationAnimation()) {
var ontick = Function.createDelegate(this, function() { this._onZoomStep(anim, 1.0, scaleFactor, startscale);ontick = null;});anim.add_tick(ontick);anim.add_ended(onEnd);this._raiseEvent('zoomStart');if (Sys.Browser.agent === Sys.Browser.InternetExplorer && this._layersDiv.filters[0]) {
this._layersDiv.filters[0].enabled = false;this._layersDiv.style.filter = ''
this._fadingStarted = false;}
anim.play();}
else {
this._raiseEvent('zoomStart');this._applyExtent(endextent);this._raiseEvent('zoomCompleted');}
return true;},
zoomTo: function(point, pixelsize, animate) {
var width = this._mapsize[0] * 0.5 * pixelsize;var height = this._mapsize[1] * 0.5 * pixelsize;var box = new ESRI.ADF.Geometries.Envelope(point.get_x() - width, point.get_y() - height,
point.get_x() + width, point.get_y() + height);return this.zoomToBox(box, animate);},
zoomToBox: function(box, animate) {
var extent = this.get_extent();if (animate === false || !extent.intersects(box)) {
this.set_extent(box);return true;}
var c = box.get_center();var wb = box.get_width();var hb = box.get_height();var ratio = this._mapsize[1] / this._mapsize[0];if (hb / wb > ratio) { wb = hb / ratio;}
else { hb = wb * ratio;}
box = new ESRI.ADF.Geometries.Envelope(c.get_x() - wb / 2, c.get_y() - hb / 2, c.get_x() + wb / 2, c.get_y() + hb / 2);var x0 = extent.get_xmin();var x1 = box.get_xmin();var ymin0 = extent.get_ymin();var ymax0 = extent.get_ymax();var ymin1 = box.get_ymin();var ymax1 = box.get_ymax();var a0 = (ymin1 - ymin0) / (x1 - x0);var a1 = (ymax1 - ymax0) / (x1 - x0);var b0 = ymin0 - a0 * x0;var b1 = ymax0 - a1 * x0;var x = (b1 - b0) / (a0 - a1);var y = a0 * x + b0;var result = this.zoom(extent.get_width() / wb, new ESRI.ADF.Geometries.Point(x, y), animate);if (result === false) { return this.panTo(box.get_center(), animate);}
else { return result;}
},
panTo: function(point, animate) {
if (this._isPanning) { return false;}
this._tmpExtent = this.get_extent();var centerScreen = this.toScreenPoint(point);var center = this.toScreenPoint(this.get_center());var ulX = center.offsetX - centerScreen.offsetX;var ulY = center.offsetY - centerScreen.offsetY;if (Math.abs(ulX) < 1 && Math.abs(ulY) < 1) { return false;} 
var width = parseInt(this.get_element().clientWidth, 10);var height = parseInt(this.get_element().clientHeight, 10);if (Math.abs(ulX) > width * 1 || Math.abs(ulY) > 2 * height) {
animate = false;}
if (animate === false || this.get_disableNavigationAnimation()) {
this._raiseEvent('panning');this._moveContainerDiv(-ulX, -ulY);this._resetGridOffset();this._raiseEvent('panCompleted', { "previous": this._tmpExtent, "current": this.get_extent() });}
else {
centerScreen = this.toScreenPoint(point);var anim = new AjaxControlToolkit.Animation.MoveAnimation(this._containerDiv, 0.5, 25, ulX, ulY, true);var onEnd = Function.createDelegate(this, function() {
anim.dispose();this._recalculateContainerOffset();anim = null;this._isPanning = false;this._raiseEvent('panCompleted', { "previous": this._tmpExtent, "current": this.get_extent() });onEnd = null;});anim.add_ended(onEnd);this._isPanning = true;anim.play();var ontick = Function.createDelegate(this, function() { this._recalculateContainerOffset();this._raiseEvent('panning');ontick = null;});anim._timer.add_tick(ontick);}
return true;},
_recalculateContainerOffset: function() {
this._containerDivPos = [parseInt(this._containerDiv.style.left, 10), parseInt(this._containerDiv.style.top, 10)];this._extent = null;},
set_extent: function(extent) {
if (!extent) { return;}
this.checkMapsize();if (this._mapsize[0] === 0 || this._mapsize[1] === 0) {
this._tmpextent = extent;if (this.get_isInitialized()) {
this._clearRequestStack();this._clearVectorGraphics();this._clearImageTiles();}
return;}
this._tmpExtent = this.get_extent();this._applyExtent(extent);if (this._suppressExtentChanged !== true) {
this._raiseEvent('extentChanged', { "previous": this._tmpExtent, "current": this.get_extent() });}
this._tmpExtent = null;},
_applyExtent: function(extent) {
var c = extent.get_center();var wb = extent.get_width();var hb = extent.get_height();var ratio = this._mapsize[1] / this._mapsize[0];if (hb / wb > ratio) { wb = hb / ratio;}
var gsd = wb / this._mapsize[0];var oldgsd = this._pixelsizeX;if (this.get_layers()) {
var level = this._layers.getLevelByNearestPixelsize(gsd);if (level !== null) {
var gsd2 = this._layers.get_levelResolution(level);if (gsd2 < gsd * 0.99 && level > 0) { 
gsd2 = this._layers.get_levelResolution(level - 1);}
gsd = gsd2;}
else {
if (this._minZoom && gsd < this._minZoom) { gsd = this._minZoom;}
else if (this._maxZoom && gsd > this._maxZoom) { gsd = this._maxZoom;}
}
}
this._pixelsizeX = this._pixelsizeY = gsd;if (oldgsd !== this._pixelsizeX) {
this._clearRequestStack();}
this._clearVectorGraphics();this._extent = null;this._gridOrigin = new ESRI.ADF.Geometries.Point(c.get_x() - this._pixelsizeX * this._mapsize[0] * 0.5,
c.get_y() + this._pixelsizeY * this._mapsize[1] * 0.5);if (!this.get_isInitialized()) { return;}
this._containerDivPos = [0, 0];this._assotateCanvas.adjustCanvasExtent(this._containerDivPos[0], this._containerDivPos[1], this._mapsize[1], this._mapsize[0]);this._containerDiv.style.left = '0';this._containerDiv.style.top = '0';this._clearImageTiles();this._raiseEvent('gridOriginChanged', this._gridOrigin);},
get_extent: function() {
if (this._extent) { return this._extent.clone();}
if (!this.get_isInitialized()) { return null;}
if (this._mapsize[0] > 0 && this._tmpextent) {
var ext = this._tmpextent;this._tmpextent = null;this._applyExtent(ext);this._addExtentHistory();}
else if (this._mapsize[0] === 0 && this._tmpextent) {
return this._tmpextent;}
else if (this._pixelsizeX === Number.POSITIVE_INFINITY) {
return this._gridOrigin.getEnvelope();}
var width = this._mapsize[0] * this._pixelsizeX;var height = this._mapsize[1] * this._pixelsizeY;var x = this._containerDivPos[0] * this._pixelsizeX;var y = this._containerDivPos[1] * this._pixelsizeY;if (this._rotation.angle !== 0) {
var x2 = (x * this._rotation.cos) - (y * this._rotation.sin);var y2 = (y * this._rotation.cos) + (x * this._rotation.sin);x = x2;y = y2;}
var left = this._gridOrigin.get_x() - x;var top = this._gridOrigin.get_y() + y;this._extent = new ESRI.ADF.Geometries.Envelope(
new ESRI.ADF.Geometries.Point(left, top - height, this._spatialReference),
new ESRI.ADF.Geometries.Point(left + width, top, this._spatialReference),
this._spatialReference);return this._extent.clone();},
get_center: function() {
return this.get_extent().get_center();},
toMapPoint: function(viewOffsetX, viewOffsetY) {
var x;var y;if (this._rotation.angle === 0) {
x = this._gridOrigin.get_x() + (viewOffsetX - this._containerDivPos[0]) * this._pixelsizeX;y = this._gridOrigin.get_y() + (this._containerDivPos[1] - viewOffsetY) * this._pixelsizeY;}
else {
var center = this.get_extent().get_center();viewOffsetX -= this._mapsize[0] / 2;viewOffsetY -= this._mapsize[1] / 2;x = viewOffsetX * this._pixelsizeX;y = -viewOffsetY * this._pixelsizeY;var x2 = ((x * this._rotation.cos) + (y * this._rotation.sin));var y2 = ((y * this._rotation.cos) - (x * this._rotation.sin));x = x2 + center.get_x();y = y2 + center.get_y();}
return new ESRI.ADF.Geometries.Point(x, y, this._spatialReference);},
_toMapScreen: function(point) {
var x = point.coordinates ? point.coordinates[0] : point[0];var y = point.coordinates ? point.coordinates[1] : point[1];if (this._rotation.angle !== 0) {
var center = this.get_extent().get_center();x -= center.coordinates[0];y -= center.coordinates[1];var x2 = Math.round(((x * this._rotation.cos) - (y * this._rotation.sin)) / this._pixelsizeX + this._mapsize[0] / 2);var y2 = Math.round(((y * this._rotation.cos) + (x * this._rotation.sin)) / this._pixelsizeY - this._mapsize[1] / 2);x = x2 - this._containerDivPos[0];y = y2 + this._containerDivPos[1];}
else {
x -= this._gridOrigin.coordinates[0];y -= this._gridOrigin.coordinates[1];x = Math.round(x / this._pixelsizeX);y = Math.round(y / this._pixelsizeY);}
return { "offsetX": x, "offsetY": -y };},
toScreenPoint: function(point) {
var obj = this._toMapScreen(point);obj.offsetX += this._containerDivPos[0];obj.offsetY += this._containerDivPos[1];return obj;},
getGeometry: function(type, onComplete, onCancel, linecolor, fillcolor, cursor, continuous) {
this.cancelGetGeometry();var style = null;if (type < ESRI.ADF.Graphics.ShapeType.Envelope) {
style = new ESRI.ADF.Graphics.LineSymbol(linecolor ? linecolor : '#000000', this.get_clientToolGraphicsWidth());}
else {
style = new ESRI.ADF.Graphics.FillSymbol(fillcolor, linecolor || fillcolor ? linecolor : '#000000', this.get_clientToolGraphicsWidth());style.set_opacity(0.2);}
var map = this;var del = null;var cancelDel = function(cancelled) {
if (cancelled) {
map._currentState = null;del = null;cancelDel = null;if (onCancel) { onCancel();}
}
};del = function(geom) {
if (!continuous && cancelDel) { cancelDel(false);}
onComplete(geom);};this.graphicsEditor = new ESRI.ADF.Graphics.__GraphicsEditor(this, this._assotateCanvas, null, type, style, del, cancelDel, continuous, cursor);this._currentState = 'getGeometry';},
cancelGetGeometry: function() {
if (this.graphicsEditor) {
this.graphicsEditor.cancel();if (this.graphicsEditor) { this.graphicsEditor.dispose();}
this.graphicsEditor = null;}
if (this._oldMouseMode) { this.set_mouseMode(this._oldMouseMode);}
this._oldMouseMode = null;this._currentState = null;},
addGraphic: function(element) {
Array.add(this._graphicFeatures, element);element.__set_map(this);if (!element.get_isInitialized()) { element.initialize();}
if (ESRI.ADF.Graphics.GraphicFeatureGroup.isInstanceOfType(element)) {
if (!this._featureGroupChangedHandler) { this._featureGroupChangedHandler = Function.createDelegate(this, function(s, e) { this._refreshGraphicsRecursive(s, true);});}
element.add_elementChanged(this._featureGroupChangedHandler);element.add_elementAdded(this._featureGroupChangedHandler);element.add_propertyChanged(this._featureGroupChangedHandler);this.refreshGraphics(false);}
else {
if (!this._featureGraphicChangedHandler) { this._featureGraphicChangedHandler = Function.createDelegate(this, this._onGraphicFeatureChanged);}
element.add_propertyChanged(this._featureGraphicChangedHandler);this._refreshGraphicsRecursive(element, false);}
},
removeGraphic: function(element) {
if (!element) { return;}
element.__set_map(null);if (ESRI.ADF.Graphics.GraphicFeatureGroup.isInstanceOfType(element)) {
element.remove_elementChanged(this._featureGroupChangedHandler);element.remove_elementAdded(this._featureGroupChangedHandler);element.remove_propertyChanged(this._featureGroupChangedHandler);element.clearGraphicReference();}
else {
element.remove_propertyChanged(this._featureGraphicChangedHandler);element.clearGraphicReference();}
Array.remove(this._graphicFeatures, element);},
_clearVectorGraphics: function() {
for (var idx = 0;idx < this._graphicFeatures.length;idx++) {
if (ESRI.ADF.Graphics.GraphicFeatureGroup.isInstanceOfType(this._graphicFeatures[idx])) {
for (var j = 0;j < this._graphicFeatures[idx].getFeatureCount();j++) {
this._graphicFeatures[idx].get(j).clearGraphicReference();}
}
else {
this._graphicFeatures[idx].clearGraphicReference();}
}
},
getShapeCount: function() {
return this._graphicFeatures.length;},
refreshGraphics: function(force) {
if (this._isZooming) { return;}
for (var idx = 0;idx < this._graphicFeatures.length;idx++) {
var feat = this._graphicFeatures[idx];this._refreshGraphicsRecursive(feat, force);}
},
_refreshGraphicsRecursive: function(element, force) {
if (ESRI.ADF.Graphics.GraphicFeatureGroup.isInstanceOfType(element)) {
if (!element.get_visible()) { return;}
for (var j = 0;j < element.getFeatureCount();j++) {
var subfeat = element.get(j);this._refreshGraphicsRecursive(subfeat, force);}
}
else {
if ((force === true || !element.get_graphicReference())) {
if (element._isDrawing) return;var fnc = Function.createDelegate(this, function() {
if (this._isZooming) { element._isDrawing = false;return;}
var elmExtent = element.getEnvelope();if (elmExtent && this.get_extent().intersects(elmExtent)) {
if (element.__draw()) {
var gfx = element.get_graphicReference();if (gfx) { element._hookEvents(element, gfx);}
}
}
element._isDrawing = false;fnc = null;});element._isDrawing = true;window.setTimeout(fnc, 0);}
}
},
_onGraphicFeatureChanged: function(sender, eventArgs) {
var prop = eventArgs.get_propertyName();if (prop === 'geometry' || prop === 'symbol' || prop === 'selectedSymbol' || prop === 'visible') {
this._refreshGraphicsRecursive(sender, true);}
},
setKeyAction: function(keycode, onkeydown, onkeyup, cursor, continuous) {
if (onkeydown !== null) {
this._keyActions[keycode] = { 'keydown': onkeydown, 'keyup': onkeyup, 'cursor': cursor, 'continuous': (continuous === true ? true : false) };}
else {
this._keyActions[keycode] = null;}
},
removeKeyAction: function(keycode) {
if (this._keyActions[keycode]) { Array.remove(this._keyActions, keycode);}
},
__get_contentDiv: function() {
return this._containerDiv;},
__get_controlDiv: function() {
return this._controlDiv;},
get_pixelSize: function() {
return this._pixelsizeX;},
get_mouseMode: function() {
return this._mouseMode;},
set_mouseMode: function(value) {
if (this._mouseMode === value) { return;}
if (this._tempDragBox) { this._removeElement(this._tempDragBox);this._tempDragBox = null;}
this.cancelGetGeometry();this._mouseMode = value;switch (this._mouseMode) {
case ESRI.ADF.UI.MouseMode.Pan: this.set_cursor('move');break;default:
this.set_cursor('crosshair');break;}
this.raisePropertyChanged('mouseMode');},
get_cursor: function() {
return this.get_element().style.cursor;},
set_cursor: function(value) { this.get_element().style.cursor = value;},
get_enableMouseWheel: function() {
return this._enableMouseWheel;},
set_enableMouseWheel: function(value) { if (value !== this._enableMouseWheel) { this._enableMouseWheel = value;this.raisePropertyChanged('enableMouseWheel');} },
get_layers: function() {
return this._layers;},
set_layers: function(value) {
if (value !== this._layers) {
this._layers = value;if (value.get_layerCount() > 0) {
var resource = value.get_layer(0);this.set_spatialReference(resource.get_spatialReference());}
if (this.get_isInitialized()) {
this._clearImageTiles();var raiseEvent = false;var level = value.getLevelByNearestPixelsize(this._pixelsizeX);if (level !== null) {
var resX = value.get_levelResolution(level);if (this._pixelsizeX !== resX) {
raiseEvent = true;}
}
this._hookupLayerCollectionEvents();if (raiseEvent) { this._raiseEvent('extentChanged');}
}
this.raisePropertyChanged('layers');}
},
get_spatialReference: function() {
return this._spatialReference;},
set_spatialReference: function(value) { if (value !== this._spatialReference) { this._spatialReference = value;this.raisePropertyChanged('spatialReference');} },
get_disableNavigationAnimation: function() {
return this._animationSettings.disableNavigationAnimation;},
set_disableNavigationAnimation: function(value) { if (value !== this._animationSettings.disableNavigationAnimation) { this._animationSettings.disableNavigationAnimation = value;this.raisePropertyChanged('disableNavigationAnimation');} },
get_disableScrollWheelZoom: function() {
return this._disableScrollWheelZoom;},
set_disableScrollWheelZoom: function(value) { if (value !== this._disableScrollWheelZoom) { this._disableScrollWheelZoom = value;this.raisePropertyChanged('disableScrollWheelZoom');} },
get_mouseWheelDirection: function() {
return this._mouseWheelDirection;},
set_mouseWheelDirection: function(value) { if (value !== this._mouseWheelDirection) { this._mouseWheelDirection = value;this.raisePropertyChanged('mouseWheelDirection');} },
get_rotation: function() {
return this._rotation.angle / Math.PI * 180.0;},
set_rotation: function(value) {
var rot = value / 180.0 * Math.PI;if (rot !== this._rotation.angle) {
this._rotation.angle = rot;this._rotation.cos = Math.cos(this._rotation.angle);this._rotation.sin = Math.sin(this._rotation.angle);this.raisePropertyChanged('rotation');}
},
set_dynTileSize: function(value) { this._dynTileSize = value;},
get_dynTileSize: function() {
return this._dynTileSize;},
get_progressBarEnabled: function() {
return this._progressBarEnabled;},
set_progressBarEnabled: function(value) {
if (this._progressBarEnabled !== value) {
this._progressBarEnabled = value;if (this._progressBarEnabled) { this._createProgressBar();}
else if (this._progressBar) {
this._progressBar.dispose();this._progressBar = null;}
}
},
get_progressBarAlignment: function() {
return this._progressBarAlignment;},
set_progressBarAlignment: function(value) {
this._progressBarAlignment = value;if (this._progressBar) { this._progressBar.set_progressBarAlignment(value);}
},
set_minZoom: function(value) { this._minZoom = value;},
get_minZoom: function() {
return this._minZoom;},
set_maxZoom: function(value) { this._maxZoom = value;},
get_maxZoom: function() {
return this._maxZoom;},
set_tileBuffer: function(value) { this._tileBuffer = value;},
get_tileBuffer: function() {
return this._tileBuffer;},
set_loadTilesContinously: function(value) { this._loadTilesContinously = value;},
get_loadTilesContinously: function() {
return this._loadTilesContinously;},
add_mouseDragging: function(handler) {
this.get_events().addHandler('mouseDragging', handler);},
remove_mouseDragging: function(handler) { this.get_events().removeHandler('mouseDragging', handler);},
add_mouseDragCompleted: function(handler) {
this.get_events().addHandler('mouseDragCompleted', handler);},
remove_mouseDragCompleted: function(handler) { this.get_events().removeHandler('mouseDragCompleted', handler);},
add_mouseMove: function(handler) {
this.get_events().addHandler('mouseMove', handler);},
remove_mouseMove: function(handler) { this.get_events().removeHandler('mouseMove', handler);},
add_mouseDown: function(handler) {
this.get_events().addHandler('mouseDown', handler);},
remove_mouseDown: function(handler) { this.get_events().removeHandler('mouseDown', handler);},
add_mouseUp: function(handler) {
this.get_events().addHandler('mouseUp', handler);},
remove_mouseUp: function(handler) { this.get_events().removeHandler('mouseUp', handler);},
add_mouseOver: function(handler) {
this.get_events().addHandler('mouseOver', handler);},
remove_mouseOver: function(handler) { this.get_events().removeHandler('mouseOver', handler);},
add_mouseOut: function(handler) {
this.get_events().addHandler('mouseOut', handler);},
remove_mouseOut: function(handler) { this.get_events().removeHandler('mouseOut', handler);},
add_click: function(handler) {
this.get_events().addHandler('click', handler);},
remove_click: function(handler) {
this.get_events().removeHandler('click', handler);},
add_dblclick: function(handler) {
this.get_events().addHandler('dblclick', handler);},
remove_dblclick: function(handler) { this.get_events().removeHandler('dblclick', handler);},
add_keyUp: function(handler) {
this.get_events().addHandler('keyUp', handler);},
remove_keyUp: function(handler) { this.get_events().removeHandler('keyUp', handler);},
add_keyDown: function(handler) {
this.get_events().addHandler('keyDown', handler);},
remove_keyDown: function(handler) { this.get_events().removeHandler('keyDown', handler);},
add_zoomStart: function(handler) {
this.get_events().addHandler('zoomStart', handler);},
remove_zoomStart: function(handler) { this.get_events().removeHandler('zoomStart', handler);},
add_zoomCompleted: function(handler) {
this.get_events().addHandler('zoomCompleted', handler);},
remove_zoomCompleted: function(handler) { this.get_events().removeHandler('zoomCompleted', handler);},
add_panning: function(handler) {
this.get_events().addHandler('panning', handler);},
remove_panning: function(handler) { this.get_events().removeHandler('panning', handler);},
add_panCompleted: function(handler) {
this.get_events().addHandler('panCompleted', handler);},
remove_panCompleted: function(handler) { this.get_events().removeHandler('panCompleted', handler);},
add_extentChanging: function(handler) {
this.get_events().addHandler('extentChanging', handler);},
remove_extentChanging: function(handler) { this.get_events().removeHandler('extentChanging', handler);},
add_extentChanged: function(handler) {
this.get_events().addHandler('extentChanged', handler);},
remove_extentChanged: function(handler) { this.get_events().removeHandler('extentChanged', handler);},
add_onProgress: function(handler) {
this.get_events().addHandler('onProgress', handler);},
remove_onProgress: function(handler) { this.get_events().removeHandler('onProgress', handler);},
add_mapResized: function(handler) {
this.get_events().addHandler('mapResized', handler);},
remove_mapResized: function(handler) { this.get_events().removeHandler('mapResized', handler);},
add_gridOriginChanged: function(handler) {
this.get_events().addHandler('gridOriginChanged', handler);},
remove_gridOriginChanged: function(handler) { this.get_events().removeHandler('gridOriginChanged', handler);},
__add_mapTipEvent: function(handler) {
this.get_events().addHandler('mapTipEvent', handler);},
__remove_mapTipEvent: function(handler) { this.get_events().removeHandler('mapTipEvent', handler);}
};ESRI.ADF.UI.MapBase.registerClass('ESRI.ADF.UI.MapBase', Sys.UI.Control);ESRI.ADF.UI.Map = function(element) {
ESRI.ADF.UI.Map.initializeBase(this, [element]);this._callbackFunctionString = null;this._onExtentsChangedHandler = null;this._onMapResizedHandler = null;this._restoreFromCookie = false;this._disableAutoCallbacks = false;this._disableDefaultKeyActions = false;};ESRI.ADF.UI.Map.prototype = {
initialize: function() {
ESRI.ADF.UI.Map.callBaseMethod(this, 'initialize');this.divObject = this._layersDiv;this._onExtentsChangedHandler = Function.createDelegate(this, this._onExtentChanged);this.add_extentChanged(this._onExtentsChangedHandler);this._onMapResizedHandler = Function.createDelegate(this, this._onMapResized);this.add_mapResized(this._onMapResizedHandler);if (!this._disableDefaultKeyActions) {
var keypanAmount = 50;var doKeyPanFunc = Function.createDelegate(this, function() { this._doContinuousPan(this._keyPanDirection[0], this._keyPanDirection[1]);});this.setKeyAction(Sys.UI.Key.right, Function.createDelegate(this, function() { this._keyPanDirection[0] = keypanAmount;doKeyPanFunc();}), Function.createDelegate(this, function() { this._keyPanDirection[0] = 0;doKeyPanFunc();}), null, true);this.setKeyAction(Sys.UI.Key.left, Function.createDelegate(this, function() { this._keyPanDirection[0] = -keypanAmount;doKeyPanFunc();}), Function.createDelegate(this, function() { this._keyPanDirection[0] = 0;doKeyPanFunc();}), null, true);this.setKeyAction(Sys.UI.Key.up, Function.createDelegate(this, function() { this._keyPanDirection[1] = -keypanAmount;doKeyPanFunc();}), Function.createDelegate(this, function() { this._keyPanDirection[1] = 0;doKeyPanFunc();}), null, true);this.setKeyAction(Sys.UI.Key.down, Function.createDelegate(this, function() { this._keyPanDirection[1] = keypanAmount;doKeyPanFunc();}), Function.createDelegate(this, function() { this._keyPanDirection[1] = 0;doKeyPanFunc();}), null, true);this.setKeyAction(33, Function.createDelegate(this, function() { this._keyPanDirection = [keypanAmount, -keypanAmount];doKeyPanFunc();}), Function.createDelegate(this, function() { this._keyPanDirection = [0, 0];doKeyPanFunc();}), null, true);this.setKeyAction(34, Function.createDelegate(this, function() { this._keyPanDirection = [keypanAmount, keypanAmount];doKeyPanFunc();}), Function.createDelegate(this, function() { this._keyPanDirection = [0, 0];doKeyPanFunc();}), null, true);this.setKeyAction(35, Function.createDelegate(this, function() { this._keyPanDirection = [-keypanAmount, keypanAmount];doKeyPanFunc();}), Function.createDelegate(this, function() { this._keyPanDirection = [0, 0];doKeyPanFunc();}), null, true);this.setKeyAction(36, Function.createDelegate(this, function() { this._keyPanDirection = [-keypanAmount, -keypanAmount];doKeyPanFunc();}), Function.createDelegate(this, function() { this._keyPanDirection = [0, 0];doKeyPanFunc();}), null, true);this.setKeyAction(107, Function.createDelegate(this, function() { this.zoom(2.0);}), null, null, false);this.setKeyAction(109, Function.createDelegate(this, function() { this.zoom(0.5);}), null, null, false);this.setKeyAction(16,
Function.createDelegate(this, function(e) {
if (this.get_mouseMode() === ESRI.ADF.UI.MouseMode.Custom) { return;}
if (!this._shiftkey_restoremode) { this._shiftkey_restoremode = { "mode": this.get_mouseMode(), "cursor": this.get_cursor() };}
this.set_mouseMode(ESRI.ADF.UI.MouseMode.ZoomIn);}),
Function.createDelegate(this, function() {
if (this._shiftkey_restoremode) { this.set_mouseMode(this._shiftkey_restoremode.mode);this.set_cursor(this._shiftkey_restoremode.cursor);this._shiftkey_restoremode = null;}
}), null, false);this.setKeyAction(17,
Function.createDelegate(this, function(e) {
if (this.get_mouseMode() === ESRI.ADF.UI.MouseMode.Custom) { return;}
if (!this._shiftkey_restoremode) { this._shiftkey_restoremode = { "mode": this.get_mouseMode(), "cursor": this.get_cursor() };}
this.set_mouseMode(ESRI.ADF.UI.MouseMode.ZoomOut);}),
Function.createDelegate(this, function() {
if (this._shiftkey_restoremode) { this.set_mouseMode(this._shiftkey_restoremode.mode);this.set_cursor(this._shiftkey_restoremode.cursor);this._shiftkey_restoremode = null;}
}), null, false);}
if (this.get_element().style.width.endsWith('%') || this.get_element().style.height.endsWith('%')) {
var ext = this.get_extent();if (this._mapsize[0] > 0 && this._mapsize[1] > 0 && ext) {
this.doCallback('EventArg=MapSizeChanged&xmin=' + ext.get_xmin() + '&ymin=' + ext.get_ymin() + '&xmax=' + ext.get_xmax() + '&ymax=' + ext.get_ymax() + '&WIDTH=' + this._mapsize[0] + '&HEIGHT=' + this._mapsize[1] + '&startup=true', this);}
}
else {
var ext = this._extent;this._extent = null;var ext2 = this.get_extent();if (ext && ext2) {
if (ext.get_xmax() !== ext2.get_xmax() || ext.get_ymax() !== ext2.get_ymax() ||
ext.get_xmin() !== ext2.get_xmin() || ext.get_ymin() !== ext2.get_ymin()) {
this._onExtentChanged();}
}
}
Maps[this.get_id()] = this;},
dispose: function() {
this.remove_extentChanged(this._onExtentsChangedHandler);this._onExtentsChangedHandler = null;this.remove_mapResized(this._onMapResizedHandler);this._onMapResizedHandler = null;ESRI.ADF.UI.Map.callBaseMethod(this, 'dispose');},
_onExtentChanged: function(sender, args) {
if (!this._disableAutoCallbacks && this._mapsize[0] > 0 && this._mapsize[1] > 0) {
var extent = args ? args.current : null;if (extent) {
this.doCallback('EventArg=ExtentChanged&xmin=' + extent.get_xmin() + '&ymin=' + extent.get_ymin() +
'&xmax=' + extent.get_xmax() + '&ymax=' + extent.get_ymax() +
'&WIDTH=' + this._mapsize[0] + '&HEIGHT=' + this._mapsize[1], this);}
}
},
_onMapResized: function(sender, args) {
if (!this._disableAutoCallbacks) {
var ext = this.get_extent();if (this._mapsize[0] > 0 && this._mapsize[1] > 0) {
this.doCallback('EventArg=MapSizeChanged&xmin=' + ext.get_xmin() + '&ymin=' + ext.get_ymin() + '&xmax=' + ext.get_xmax() + '&ymax=' + ext.get_ymax() + '&WIDTH=' + this._mapsize[0] + '&HEIGHT=' + this._mapsize[1], this);}
}
},
doCallback: function(argument, context) {
var args = { 'argument': argument };this._raiseEvent('onServerRequest', args);ESRI.ADF.System._doCallback(this._callbackFunctionString, this.get_uniqueID(), this.get_element().id, args.argument, context);},
processCallbackResult: function(action, params) {
if (action === 'insertLayer') {
var layer = $find(params[0]);if (layer) {
throw Error.invalidOperation('Cannot insert layer. ComponentID "' + params[0] + '" already in use.');}
layer = eval(params[1]);var idx = params[2];this.get_layers().insert(layer, idx);return true;}
else if (action === 'removeLayer') {
var remlayer = $find(params[0]);if (remlayer) {
this.get_layers().remove(remlayer);remlayer.dispose();return true;}
}
else if (action === 'moveLayer') {
var movelayer = $find(params[0]);if (!movelayer) {
return false;}
var from = params[1];var to = params[2];this.get_layers().remove(movelayer);this.get_layers().insert(movelayer, to);}
else if (action === "refreshLayer") {
var layerid = params[0];var reflayer = $find(layerid);var idx = params[2];if (reflayer) {
this.get_layers().remove(reflayer);reflayer.dispose();}
reflayer = eval(params[1]);this.get_layers().insert(reflayer, idx);return true;}
else if (action === "addGraphicsLayer") {
var addgfxlayer = ESRI.ADF.Graphics.__AdfGraphicsLayer.parseJsonLayer(params[1], this);if (addgfxlayer) { this.addGraphic(addgfxlayer);return true;}
}
else if (action === "removeGraphicsLayer") {
var remlayerid = this.get_id() + '_' + params[0];var remgfxlayer = $find(remlayerid);if (!remgfxlayer) { return false;}
this.removeGraphic(remgfxlayer);remgfxlayer.dispose();return true;}
else if (action === "clearGraphicsLayer") {
var remlayerid = this.get_id() + '_' + params[0];var remgfxlayer = $find(remlayerid);if (!remgfxlayer) { return false;}
remgfxlayer.clear();return true;}
else if (action === "updateGraphicsLayerRow") {
var upgfxlayerid = this.get_id() + '_' + params[0];var upGfxlayer = $find(upgfxlayerid);if (!upGfxlayer) { return false;}
var uprow = $find(upgfxlayerid + '_' + params[1]);if (!uprow) { return false;}
var rowidx = upGfxlayer.indexOf(uprow);upGfxlayer.remove(uprow);uprow.dispose();uprow = ESRI.ADF.Graphics.__AdfGraphicsLayer._parseRow(eval('(' + params[2] + ')'), upgfxlayerid);upGfxlayer.insert(uprow, rowidx);return true;}
else if (action === "addGraphicsLayerRow") {
var addgfxlayerid = this.get_id() + '_' + params[0];var addgfxlayer2 = $find(addgfxlayerid);if (!addgfxlayer2) { return false;}
var row = ESRI.ADF.Graphics.__AdfGraphicsLayer._parseRow(eval('(' + params[2] + ')'), addgfxlayerid);addgfxlayer2.add(row);return true;}
else if (action === "deleteGraphicsLayerRow") {
var dellayerid = this.get_id() + '_' + params[0];var delgfxlayer = $find(dellayerid);if (!delgfxlayer) { return false;}
var delrow = $find(dellayerid + '_' + params[1]);if (!delrow) { return false;}
delgfxlayer.remove(delrow);delrow.dispose();return true;}
else if (action === "setextent") {
this._disableAutoCallbacks = true;this.set_extent(new ESRI.ADF.Geometries.Envelope(params[0], params[1], params[2], params[3]));this._disableAutoCallbacks = false;return true;}
else if (action === "zoomToBox") {
this._disableAutoCallbacks = true;this.zoomToBox(new ESRI.ADF.Geometries.Envelope(parseFloat(params[0]), parseFloat(params[1]), parseFloat(params[2]), parseFloat(params[3])), true);this._disableAutoCallbacks = false;return true;}
return false;},
get_uniqueID: function() {
return this._uniqueID;},
set_uniqueID: function(value) {
this._uniqueID = value;},
get_callbackFunctionString: function() {
return this._callbackFunctionString;},
set_callbackFunctionString: function(value) {
this._callbackFunctionString = value;},
set_clientToolGraphicsColor: function(value) { this._clientToolGraphicsColor = value;},
get_clientToolGraphicsColor: function() {
return this._clientToolGraphicsColor;},
set_clientToolGraphicsWidth: function(value) { this._clientToolGraphicsWidth = value;},
get_clientToolGraphicsWidth: function() {
return this._clientToolGraphicsWidth;},
add_onServerRequest: function(handler) {
this.get_events().addHandler('onServerRequest', handler);},
remove_onServerRequest: function(handler) { this.get_events().removeHandler('onServerRequest', handler);}
};ESRI.ADF.UI.Map.registerClass('ESRI.ADF.UI.Map', ESRI.ADF.UI.MapBase);/////////////////////////////////// Set Tool Functions /////////////////////////////////////
Type.registerNamespace('ESRI.ADF.MapTools');ESRI.ADF.MapTools.fillColor = null;ESRI.ADF.MapTools.lineColor = 'black';MapDragImage = ESRI.ADF.MapTools.MapDragImage = function(mapid, mode, showLoading, cursor) {
var map = $find(mapid);if (!map) { map = Pages[mapid];}
if (ESRI.ADF.UI.Map.isInstanceOfType(map)) {
map.set_mouseMode(ESRI.ADF.UI.MouseMode.Pan);if (cursor) {
map.set_cursor(cursor);}
}
else if (ESRI.ADF.UI.Page.isInstanceOfType(map)) {
ESRI.ADF.PageTools.PageMapDragImage(mapid, mode, showLoading, cursor);}
};MapDragRectangle = ESRI.ADF.MapTools.DragRectangle = function(mapid, mode, showLoading, cursor) {
var map = $find(mapid);if (!map) { map = Pages[mapid];}
if (ESRI.ADF.UI.Map.isInstanceOfType(map)) {
if (mode === 'MapZoomIn') {
map.set_mouseMode(ESRI.ADF.UI.MouseMode.ZoomIn);}
else if (mode === 'MapZoomOut') {
map.set_mouseMode(ESRI.ADF.UI.MouseMode.ZoomOut);}
else {
var onComplete = Function.createDelegate(map, function(geom) {
var geomString = geom.get_xmin() + ':' + geom.get_ymin() + '|' + geom.get_xmax() + ':' + geom.get_ymax();this.doCallback('EventArg=DragRectangle&coords=' + geomString + '&' + mapid + '_mode=' + mode, this);});map.getGeometry(ESRI.ADF.Graphics.ShapeType.Envelope, onComplete, function() { map.__activeToolMode = null;}, map.get_clientToolGraphicsColor(), ESRI.ADF.MapTools.fillColor, cursor, true);map.__activeToolMode = mode;}
if (cursor) {
map.set_cursor(cursor);}
}
else if (ESRI.ADF.UI.Page.isInstanceOfType(map)) {
ESRI.ADF.PageTools.PageMapDragRectangle(mapid, mode, showLoading, cursor);}
};MapBox = MapDragBox = ESRI.ADF.MapTools.DragRectangle;MapPoint = ESRI.ADF.MapTools.Point = function(mapid, mode, showLoading, cursor) {
var map = $find(mapid);if (!map) { map = Pages[mapid];}
if (ESRI.ADF.UI.Map.isInstanceOfType(map)) {
var onComplete = Function.createDelegate(map, function(geom) {
this.doCallback('EventArg=Point&coords=' + geom.toString(':') + '&' + mapid + '_mode=' + mode, this);});map.getGeometry(ESRI.ADF.Graphics.ShapeType.Point, onComplete, function() { map.__activeToolMode = null;}, null, null, cursor, true);map.__activeToolMode = mode;}
else if (ESRI.ADF.UI.Page.isInstanceOfType(map)) {
ESRI.ADF.PageTools.PageMapPoint(mapid, mode, showLoading, cursor);}
};MapLine = ESRI.ADF.MapTools.Line = function(mapid, mode, showLoading, cursor, vectorToolbarState) {
var map = $find(mapid);var onComplete = Function.createDelegate(map, function(geom) {
var geomString = geom.getPath(0).toString('|', ':');this.doCallback('EventArg=Line&coords=' + geomString + '&' + mapid + '_mode=' + mode, this, null);});map.getGeometry(ESRI.ADF.Graphics.ShapeType.Line, onComplete, function() { map.__activeToolMode = null;}, map.get_clientToolGraphicsColor(), null, cursor, true);map.__activeToolMode = mode;};MapPolyline = ESRI.ADF.MapTools.Polyline = function(mapid, mode, showLoading, cursor, vectorToolbarState) {
var map = $find(mapid);var onComplete = Function.createDelegate(map, function(geom) {
var geomString = geom.getPath(0).toString('|', ':');this.doCallback('EventArg=Polyline&coords=' + geomString + '&' + mapid + '_mode=' + mode, this);});map.getGeometry(ESRI.ADF.Graphics.ShapeType.Path, onComplete, function() { map.__activeToolMode = null;}, map.get_clientToolGraphicsColor(), null, cursor, true);map.__activeToolMode = mode;};MapPolygon = ESRI.ADF.MapTools.Polygon = function(mapid, mode, showLoading, cursor, vectorToolbarState) {
var map = $find(mapid);var onComplete = Function.createDelegate(map, function(geom) {
var geomString = geom.getRing(0).toString('|', ':');this.doCallback('EventArg=Polygon&coords=' + geomString + '&' + mapid + '_mode=' + mode, this);});map.getGeometry(ESRI.ADF.Graphics.ShapeType.Ring, onComplete, function() { map.__activeToolMode = null;}, map.get_clientToolGraphicsColor(), ESRI.ADF.MapTools.fillColor, cursor, true);map.__activeToolMode = mode;};MapDragCircle = MapCircle = ESRI.ADF.MapTools.Circle = function(mapid, mode, showLoading, cursor, vectorToolbarState) {
var map = $find(mapid);var onComplete = Function.createDelegate(map, function(geom) {
var geomString = geom.get_center().toString(':') + ':' + geom.get_width() * 0.5;this.doCallback('EventArg=Circle&coords=' + geomString + '&' + mapid + '_mode=' + mode, this);});map.getGeometry(ESRI.ADF.Graphics.ShapeType.Circle, onComplete, function() { map.__activeToolMode = null;}, map.get_clientToolGraphicsColor(), ESRI.ADF.MapTools.fillColor, cursor, true);map.__activeToolMode = mode;};MapDragOval = MapOval = ESRI.ADF.MapTools.Oval = function(mapid, mode, showLoading, cursor, vectorToolbarState) {
var map = $find(mapid);var onComplete = Function.createDelegate(map, function(geom) {
var geomString = geom.get_center().toString(':') + ':' + Math.abs(geom.get_width()) + ':' + Math.abs(geom.get_height());this.doCallback('EventArg=Oval&coords=' + geomString + '&' + mapid + '_mode=' + mode, this);});map.getGeometry(ESRI.ADF.Graphics.ShapeType.Oval, onComplete, function() { map.__activeToolMode = null;}, map.get_clientToolGraphicsColor(), ESRI.ADF.MapTools.fillColor, cursor, true);map.__activeToolMode = mode;};MapTips = ESRI.ADF.MapTools.MapTips = function(mapid, mode, showLoading, cursor) {
throw (new Error.notImplemented('MapTips'));};ESRI.ADF.UI.MapBase.prototype.resize = function(width, height, resizeExtent) { };Maps = [];ESRI.ADF.UI.ProgressBarExtender = function() {
ESRI.ADF.UI.ProgressBarExtender.initializeBase(this);this._height = 10;this._map = null;this._width = null;this._barIsVisible = false;this._opacity = 0.35;this._maxNoOfTiles = 1;this._displayDelay = 1000;this._spinnerPosition = null;this._barColor = '#666';this._colors = ['#99f', '#99d', '#99b'];this._progressBarAlignment = ESRI.ADF.System.ContentAlignment.BottomRight;};ESRI.ADF.UI.ProgressBarExtender.prototype = {
initialize: function() {
var bounds = Sys.UI.DomElement.getBounds(this._map.get_element());this._pbar = document.createElement('div');this._pbar.style.position = 'absolute';this._pbar.style.zIndex = 10000;this._pbar.style.height = this._height + 'px';this._pbar.style.width = this._width;this._pbar.style.border = 'solid 1px #000';this._pbar.style.backgroundColor = '#fff';this._pbar.style.overflow = 'hidden';this._pbar.style.fontSize = '1px';ESRI.ADF.System.setOpacity(this._pbar, 0.0);this._bar = document.createElement('div');this._bar.style.height = this._height + 'px';this._bar.style.width = '0';this._bar.style.backgroundColor = this._barColor;this._bar.style.position = 'relative';this._spinner = document.createElement('div');for (var i = 0;i < this._colors.length;i++) {
var stripe = document.createElement('div');stripe.style.width = '8px';stripe.style.height = this._height + 'px';stripe.style.marginLeft = '1px';stripe.style.backgroundColor = this._colors[i];stripe.style.position = 'absolute';stripe.style.left = 9 * i + 'px';stripe.style.top = '0px';this._spinner.appendChild(stripe);}
this._spinnerWidth = 9 * this._colors.length;this._spinner.style.position = 'relative';this._spinner.style.left = 0;this._spinner.style.zIndex = 1;this._pbar.appendChild(this._spinner);document.body.appendChild(this._pbar);this._pbar.appendChild(this._bar);this._barWidth = parseInt(this._pbar.clientWidth, 10);this._animation1 = new AjaxControlToolkit.Animation.FadeAnimation(this._pbar, 0.25, 25, AjaxControlToolkit.Animation.FadeEffect.FadeIn, 0, this._opacity, true);this._animation2 = new AjaxControlToolkit.Animation.FadeAnimation(this._pbar, 0.25, 25, AjaxControlToolkit.Animation.FadeEffect.FadeOut, 0, this._opacity, true);this._animation1.add_started(Function.createDelegate(this, function() { this._pbar.style.display = '';}));this._animation2.add_ended(Function.createDelegate(this, function() { this._pbar.style.display = 'none';}));this._onProgressHandler = Function.createDelegate(this, this._onProgress);this._zoomStartHandler = Function.createDelegate(this, this._onZoom);this._spinnerAnimateHandler = Function.createDelegate(this, this._spinnerAnimate);this._mapChanged = Function.createDelegate(this, this._repositionProgressBar);this._map.add_onProgress(this._onProgressHandler);this._map.add_zoomStart(this._zoomStartHandler);this._map.add_mapResized(this._mapChanged);this._repositionProgressBar();},
_onLayersChanged: function(s, e) {
if (e.get_propertyName() == 'layers') {
s.get_layers().add_layerAdded(this._mapChanged);s.get_layers().add_layerRemoved(this._mapChanged);this._mapChanged();}
},
dispose: function() {
if (this._isDisposed || !this.get_isInitialized()) { return;}
this._map.get_layers().remove_layerAdded(this._mapChanged);this._map.get_layers().remove_layerRemoved(this._mapChanged);this._map.remove_mapResized(this._mapChanged);this._map.remove_onProgress(this._onProgressHandler);this._map.remove_zoomStart(this._zoomStartHandler);this._mapChanged = null;this._onProgressHandler = null;this._zoomStartHandler = null;this._animation1.dispose();this._animation2.dispose();if (this._pbar && this._pbar.parentNode) { this._pbar.parentNode.removeChild(this._pbar);}
this._bar = null;this._pbar = null;this._isDisposed = true;},
_spinnerAnimate: function() {
if (this._spinnerPosition === null || this._spinnerPosition > parseInt(this._barWidth, 10)) { this._spinnerPosition = -this._spinnerWidth;}
else { this._spinnerPosition += 5;}
this._spinner.style.left = this._spinnerPosition + 'px';if (this._barIsVisible) {
this._spinnerTimer = window.setTimeout(this._spinnerAnimateHandler, 50);}
else { this._spinnerPosition = null;}
},
_showProgressBar: function() {
this._showTimer = null;if (this._barIsVisible) {
this._animation2.stop();this._spinnerAnimate();this._animation1.play();}
},
_onZoom: function() {
this._animation1.stop();this._animation2.stop();ESRI.ADF.System.setOpacity(this._pbar, 0.0);this._barIsVisible = false;this._maxNoOfTiles = 1;},
_onProgress: function(s, e) {
if (!this._barIsVisible && e > 0) {
if (!this._showProgressBarHandler) { this._showProgressBarHandler = Function.createDelegate(this, this._showProgressBar);}
this._showTimer = window.setTimeout(this._showProgressBarHandler, this._displayDelay);this._barIsVisible = true;}
if (e > this._maxNoOfTiles) { this._maxNoOfTiles = e;} 
var width = Math.round(this._barWidth / this._maxNoOfTiles) * (this._maxNoOfTiles - e);if (width > this._barWidth) { width = this._barWidth;}
else if (width < 0) { width = 0;}
this._bar.style.width = width + 'px';if (e === 0 && this._barIsVisible) {
if (this._showTimer) {
window.clearTimeout(this._showTimer);this._showTimer = null;}
else {
this._animation1.stop();this._animation2.play();}
this._spinnerTimer = null;this._barIsVisible = false;}
},
_repositionProgressBar: function() {
if (!this._pbar || !this._map._controlDiv) { return;}
var bounds = Sys.UI.DomElement.getBounds(this._map._controlDiv);if (this._progressBarAlignment & 1092) { this._pbar.style.left = (bounds.x + bounds.width - this._barWidth - 5) + 'px';}
else if (this._progressBarAlignment & 546) { this._pbar.style.left = (bounds.x + (bounds.width - this._barWidth) / 2) + 'px';}
else { this._pbar.style.left = bounds.x + 5 + 'px';}
if (this._progressBarAlignment & 1792) { this._pbar.style.top = (bounds.y + bounds.height - this._height - 7) + 'px';}
else if (this._progressBarAlignment & 112) { this._pbar.style.top = (bounds.y + (this._height + bounds.height) / 2) + 'px';}
else { this._pbar.style.top = (bounds.y + this._height - 7) + 'px';}
},
get_map: function() { return this._map;},
set_map: function(value) { this._map = value;},
get_width: function() { return this._width;},
set_width: function(value) { this._width = value;},
get_progressBarAlignment: function() { return this._progressBarAlignment;},
set_progressBarAlignment: function(value) { this._progressBarAlignment = value;this._repositionProgressBar();}
};ESRI.ADF.UI.ProgressBarExtender.registerClass('ESRI.ADF.UI.ProgressBarExtender', Sys.Component);if (typeof (Sys) !== "undefined") { Sys.Application.notifyScriptLoaded();}

//END ESRI.ArcGIS.ADF.Web.UI.WebControls.Runtime.JavaScript.ESRI.ADF.UI.Map.release.js
//START ESRI.ArcGIS.ADF.Web.UI.WebControls.Runtime.JavaScript.ESRI.ADF.UI.ScaleBar.release.js
Type.registerNamespace('ESRI.ADF.UI');ESRI.ADF.UI._ScaleBarUnits = function() {
};ESRI.ADF.UI._ScaleBarUnits.prototype = {
DecimalDegrees: { "unitsPerMeter": -1, "DisplayName": '&deg;' },
Inches: { "unitsPerMeter": 0.0254, "DisplayName": 'Inches' },
Feet: { "unitsPerMeter": 0.3048, "DisplayName": 'Feet' },
Yards: { "unitsPerMeter": 0.9144, "DisplayName": 'Yards' },
Miles: { "unitsPerMeter": 1609.344, "DisplayName": 'Miles' },
NauticalMiles: { "unitsPerMeter": 1852, "DisplayName": 'Nautical Miles' },
Millimeters: { "unitsPerMeter": 0.001, "DisplayName": 'Millimeters' },
Centimeters: { "unitsPerMeter": 0.01, "DisplayName": 'Centimeters' },
Decimeters: { "unitsPerMeter": 0.1, "DisplayName": 'Decimeters' },
Meters: { "unitsPerMeter": 1, "DisplayName": 'Meters' },
Kilometers: { "unitsPerMeter": 1000, "DisplayName": 'Kilometers' },
Unknown: { "unitsPerMeter": 1, "DisplayName": '' },
convert: function(value, from, to) {
if (from === ESRI.ADF.UI.ScaleBarUnits.DecimalDegrees) { throw Error.argument("Cannot convert from geographic", "from");}
if (to === ESRI.ADF.UI.ScaleBarUnits.DecimalDegrees) { throw Error.argument("Cannot convert to geographic", "to");}
return value * from.unitsPerMeter / to.unitsPerMeter;},
switchUnit: function(from, unitGroup) {
var to = null;if (unitGroup !== null) {
switch (unitGroup) {
case ESRI.ADF.UI.ScaleBarUnitConversionGroup.MilesFeet:
return from === ESRI.ADF.UI.ScaleBarUnits.Miles ? ESRI.ADF.UI.ScaleBarUnits.Feet : null;break;case ESRI.ADF.UI.ScaleBarUnitConversionGroup.KilometersMeters:
return from === ESRI.ADF.UI.ScaleBarUnits.Kilometers ? ESRI.ADF.UI.ScaleBarUnits.Meters : null;break;}
}
if (to === null) {
switch (from) {
case ESRI.ADF.UI.ScaleBarUnits.Miles:
to = ESRI.ADF.UI.ScaleBarUnits.Yards;break;case ESRI.ADF.UI.ScaleBarUnits.Yards:
to = ESRI.ADF.UI.ScaleBarUnits.Feet;break;case ESRI.ADF.UI.ScaleBarUnits.Feet:
to = ESRI.ADF.UI.ScaleBarUnits.Inches;break;case ESRI.ADF.UI.ScaleBarUnits.Kilometers:
to = ESRI.ADF.UI.ScaleBarUnits.Meters;break;case ESRI.ADF.UI.ScaleBarUnits.Meters:
to = ESRI.ADF.UI.ScaleBarUnits.Decimeters;break;case ESRI.ADF.UI.ScaleBarUnits.Decimeters:
to = ESRI.ADF.UI.ScaleBarUnits.Centimeters;break;case ESRI.ADF.UI.ScaleBarUnits.Centimeters:
to = ESRI.ADF.UI.ScaleBarUnits.Millimeters;break;}
}
return to;}
};ESRI.ADF.UI.ScaleBarUnits = new ESRI.ADF.UI._ScaleBarUnits();ESRI.ADF.UI.ScaleBarStyle = function() {
};ESRI.ADF.UI.ScaleBarStyle.prototype = { Alternating: 0, DoubleAlternating: 1, SingleDivision: 2, ScaleLine: 3 };ESRI.ADF.UI.ScaleBarStyle.registerEnum("ESRI.ADF.UI.ScaleBarStyle");ESRI.ADF.UI.ScaleBarUnitConversionGroup = function() {
};ESRI.ADF.UI.ScaleBarUnitConversionGroup.prototype = { MilesFeet: 0, USUnits: 1, KilometersMeters: 2, MetricUnits: 3 };ESRI.ADF.UI.ScaleBarUnitConversionGroup.registerEnum("ESRI.ADF.UI.ScaleBarUnitConversionGroup");ESRI.ADF.UI.ScaleBarNumberPosition = function() {
};ESRI.ADF.UI.ScaleBarNumberPosition.prototype = { Above: 0, Below: 1 };ESRI.ADF.UI.ScaleBarNumberPosition.registerEnum("ESRI.ADF.UI.ScaleBarNumberPosition");ESRI.ADF.UI._IScaleBarRenderer = function() { };ESRI.ADF.UI._IScaleBarRenderer.prototype = {
create: function(containerDiv) { },
onExtentChanged: function(sender, args) { },
dispose: function() { }
};ESRI.ADF.UI._IScaleBarRenderer.registerInterface('ESRI.ADF.UI._IScaleBarRenderer');ESRI.ADF.UI._ScaleBarRendererBase = function(props) {
this._textbars = null;this._mapUnit = props ? props.mapUnit : null;this._displayUnit = props ? props.displayUnit : null;this._significantDigits = props ? props.significantDigits : -1;this._numberOfDivisions = props ? props.numberOfDivisions : false;this._scaleBarNumberPosition = props ? props.scaleBarNumberPosition : ESRI.ADF.UI.ScaleBarNumberPosition.Above;this._scaleBarUnitConversionGroup = props ? props.scaleBarUnitConversionGroup : ESRI.ADF.UI.ScaleBarUnitConversionGroup.MilesFeet;this._barHeight = props ? props.barHeight : 8;this._barFontSize = props ? props.barFontSize : 16;this._foreColor = props ? props.foreColor : 'black';this._barColor = props ? props.barColor : 'black';this._useDoubleAlternatingStyle = props ? props.useDoubleAlternatingStyle : false;this._labelText = props ? props.labelText : '';this._labels = this._labelText.split(';');this._containerDiv = null;this._marksDiv = null;this._currentPixelSize = null;this._earthRadius = 6378137;this._toRadians = Math.PI / 180;this._degreeDist = this._earthRadius * this._toRadians;};ESRI.ADF.UI._ScaleBarRendererBase.prototype = {
_create: function(containerDiv) {
this._containerDiv = containerDiv;this._createTextPlaceHolders(containerDiv, this._scaleBarNumberPosition, this._barHeight, this._barFontSize, this._foreColor);this._marksDiv = this._createTopBar(containerDiv, this._scaleBarNumberPosition, this._barHeight, this._barFontSize, this._barColor);if (this._useDoubleAlternatingStyle) {
this._createBottomBar(this._marksDiv, this._scaleBarNumberPosition, this._barHeight, this._barFontSize, this._barColor);}
containerDiv.appendChild(this._marksDiv);},
_onExtentChanged: function(sender, args) {
var extent = args.extent;var pixelSize = args.pixelSize;var maxWidth = args.maxWidth;var unit = this._displayUnit;if (this._mapUnit === ESRI.ADF.UI.ScaleBarUnits.Unknown) { unit = ESRI.ADF.UI.ScaleBarUnits.Unknown;}
var stepwidth = maxWidth / this._numberOfDivisions; //width of one sub-bar 
var val = 0;var originalPixelSize = pixelSize;while (val < 0.5) {
pixelSize = originalPixelSize;if (this._mapUnit === ESRI.ADF.UI.ScaleBarUnits.DecimalDegrees) {
pixelSize = this._getScaleForGeographic(extent, pixelSize);pixelSize = ESRI.ADF.UI.ScaleBarUnits.convert(pixelSize, ESRI.ADF.UI.ScaleBarUnits.Meters, unit);}
else if (this._mapUnit !== ESRI.ADF.UI.ScaleBarUnits.Unknown) { pixelSize = ESRI.ADF.UI.ScaleBarUnits.convert(pixelSize, this._mapUnit, unit);}
var val = stepwidth * pixelSize;val = this._roundToSignificant(val, pixelSize);if (val < 0.5) {
var newUnit = ESRI.ADF.UI.ScaleBarUnits.switchUnit(unit, this._scaleBarUnitConversionGroup);if (newUnit === null) { break;} 
unit = newUnit;}
}
this._marksDiv.style.display = pixelSize === 0 ? 'none' : '';if (this._currentPixelSize === pixelSize) {
return;}
this._currentPixelSize = pixelSize;if (val < 1) {
var tmp = Math.ceil(1 / val);if (tmp < 5) { val = 1 / tmp;}
else if (tmp < 4) { val = 0.2;}
else if (tmp < 2) { val = 0.25;}
else if (tmp <= 1) { val = 0.5;}
}
else {
val = Math.floor(stepwidth * pixelSize);}
var vals = (this._numberOfDivisions === 8) ? [1, 2, 4, 6, 8] : [1];var label = this._getLabelText(unit, this._scaleBarUnitConversionGroup);Array.forEach(vals, function(item, j) {
var rounded = val * item;var elm = this._textbars[j + 1];if (rounded < 1 && j < 4) {
if (rounded == 0.5) { rounded = '&frac12;';}
else if (rounded == 0.25) { rounded = '&frac14;';}
else if (rounded == 0.75) { rounded = '&frac34;';}
else if (rounded.toString().length > 4) { rounded = Math.round(rounded * Math.pow(10, j)) / Math.pow(10, j);}
}
else if (rounded.toString().length > 4) { rounded = Math.round(rounded * Math.pow(10, j)) / Math.pow(10, j); } //add more digits to last values
if (rounded === 0) { elm.innerHTML = '';}
else {
var dotPos = rounded.toString().lastIndexOf('.');if (dotPos > -1) {
if (this._significantDigits > 0) { rounded = rounded.localeFormat('N' + this._significantDigits.toString());}
else if (this._significantDigits === 0) { rounded = rounded.toString().substring(0, dotPos);}
}
if (j === 4) { elm.innerHTML = '<nobr>' + rounded + ' ' + label + '</nobr>';}
else { elm.innerHTML = rounded;}
}
}, this);var width = (val / pixelSize * this._numberOfDivisions);if (width > 0) { this._containerDiv.style.width = (Math.round(width) + 'px');}
else { this._containerDiv.style.width = maxWidth + 'px';}
return width;},
_dispose: function() {
this._currentPixelSize = null;this._containerDiv = null;this._textbars = null;this._marksDiv = null;},
_roundToSignificant: function(value, resolution) {
var round = Math.floor(-Math.log(resolution));if (round > 0) {
round = Math.pow(10, round);return Math.round(value * round) / round;}
else { return Math.round(value);}
},
_getBestEstimateOfValue: function(extent, pixelSize, maxWidth) {
var unit = this._displayUnit;if (this._mapUnit === ESRI.ADF.UI.ScaleBarUnits.Unknown) { unit = ESRI.ADF.UI.ScaleBarUnits.Unknown;}
var rounded = 0;var originalPixelSize = pixelSize;while (rounded < 0.5) {
pixelSize = originalPixelSize;if (this._mapUnit === ESRI.ADF.UI.ScaleBarUnits.DecimalDegrees) {
pixelSize = this._getScaleForGeographic(extent, pixelSize);pixelSize = ESRI.ADF.UI.ScaleBarUnits.convert(pixelSize, ESRI.ADF.UI.ScaleBarUnits.Meters, unit);}
else if (this._mapUnit !== ESRI.ADF.UI.ScaleBarUnits.Unknown) { pixelSize = ESRI.ADF.UI.ScaleBarUnits.convert(pixelSize, this._mapUnit, unit);}
var val = maxWidth * pixelSize;val = this._roundToSignificant(val, pixelSize);var noFrac = Math.round(val);if (val < 0.5) {
var newUnit = ESRI.ADF.UI.ScaleBarUnits.switchUnit(unit, this._scaleBarUnitConversionGroup);if (newUnit == null) { break;} 
unit = newUnit;}
else if (noFrac > 1) {
rounded = noFrac;var len = noFrac.toString().length;if (len <= 2) {
if (noFrac > 5) {
rounded -= noFrac % 5;}
while (rounded > 1 && (rounded / pixelSize) > maxWidth) {
var decr = noFrac > 5 ? 5 : 1;rounded = rounded - decr;}
}
else if (len > 2) {
rounded = Math.round(noFrac / Math.pow(10, len - 1)) * Math.pow(10, len - 1);if ((rounded / pixelSize) > maxWidth) {
rounded = Math.floor(noFrac / Math.pow(10, len - 1)) * Math.pow(10, len - 1);}
}
}
else { 
rounded = Math.floor(val);if (rounded == 0) {
rounded = (val == 0.5) ? 0.5 : 1;if ((rounded / pixelSize) > maxWidth) {
rounded = 0;var newUnit = ESRI.ADF.UI.ScaleBarUnits.switchUnit(unit, this._scaleBarUnitConversionGroup);if (newUnit == null) { break;} 
unit = newUnit;}
}
}
}
return { "rounded": rounded, "unit": unit, "pixelSize": pixelSize };},
_setLabelText: function(elm, rounded, u) {
if (rounded == 0.5) { elm.innerHTML = '&frac12;';}
if (rounded === 0) { elm.innerHTML = '0';}
else {
var label = this._getLabelText(u, this._scaleBarUnitConversionGroup);var dotPos = rounded.toString().lastIndexOf('.');if (dotPos > -1) {
if (this._significantDigits > 0) { rounded = rounded.localeFormat('N' + this._significantDigits.toString());}
else if (this._significantDigits === 0) { rounded = rounded.toString().substring(0, dotPos);}
}
elm.innerHTML = '<nobr>' + rounded + ' ' + label + '</nobr>';}
},
_getLabelText: function(unit, unitGroup) {
if (!unit) { unit = ESRI.ADF.UI.ScaleBarUnits.Unknown;}
if (this._labelText && this._labelText.length > 0) {
var idx = this._getIndexOfUnitInGroup(unit, unitGroup);if (idx > -1 && idx < this._labels.length) {
return this._labels[idx];}
}
return unit.DisplayName;},
_getIndexOfUnitInGroup: function(unit, unitGroup) {
switch (unitGroup) {
case ESRI.ADF.UI.ScaleBarUnitConversionGroup.MilesFeet:
if (unit === ESRI.ADF.UI.ScaleBarUnits.Miles) { return 0;}
else if (unit === ESRI.ADF.UI.ScaleBarUnits.Feet) { return 1;}
break;case ESRI.ADF.UI.ScaleBarUnitConversionGroup.KilometersMeters:
if (unit === ESRI.ADF.UI.ScaleBarUnits.Kilometers) { return 0;}
else if (unit === ESRI.ADF.UI.ScaleBarUnits.Meters) { return 1;}
break;case ESRI.ADF.UI.ScaleBarUnitConversionGroup.USUnits:
switch (unit) {
case ESRI.ADF.UI.ScaleBarUnits.Miles:
return 0;case ESRI.ADF.UI.ScaleBarUnits.Yards:
return 1;case ESRI.ADF.UI.ScaleBarUnits.Feet:
return 2;}
break;case ESRI.ADF.UI.ScaleBarUnitConversionGroup.MetricUnits:
switch (unit) {
case ESRI.ADF.UI.ScaleBarUnits.Kilometers:
return 0;case ESRI.ADF.UI.ScaleBarUnits.Meters:
return 1;case ESRI.ADF.UI.ScaleBarUnits.Decimeters:
return 2;case ESRI.ADF.UI.ScaleBarUnits.Centimeters:
return 3;case ESRI.ADF.UI.ScaleBarUnits.Millimeters:
return 4;}
break;}
return -1;},
_createTextPlaceHolders: function(containerDiv, scaleBarNumberPosition, barHeight, barFontSize, foreColor) {
var textbar = document.createElement('div');textbar.style.width = '100%';textbar.style.position = 'absolute';textbar.style.left = '-2px';textbar.style.fontSize = barFontSize + 'px';textbar.style.color = foreColor;var top = (scaleBarNumberPosition === ESRI.ADF.UI.ScaleBarNumberPosition.Above) ? '0px' : ((barHeight + 4) + 'px');textbar.style.top = top;var arr = (this._numberOfDivisions === 8) ? [0, 12.5, 25, 50, 75, 100] : [0];this._textbars = [];Array.forEach(arr, function(val, idx) {
var bar = document.createElement('div');bar.style.position = 'absolute';bar.style.left = val + '%';textbar.appendChild(bar);this._textbars[idx] = bar;}, this);this._textbars[0].innerHTML = '0';containerDiv.appendChild(textbar);},
_createTopBar: function(containerDiv, scaleBarNumberPosition, barHeight, barFontSize, barColor) {
var arr = (this._numberOfDivisions === 8) ? [6.25, 6.25, 6.25, 6.25, 25, 25, 25] : [100];var marks = document.createElement('div');marks.style.width = '100%';marks.style.padding = '0';marks.style.margin = '0';marks.style.fontSize = '0';var top = document.createElement('div');var height = Math.ceil(barHeight / 2);top.style.width = '100%';top.style.height = height + 'px';top.style.position = 'relative';top.style.overflow = 'hidden';top.style.border = '1px solid black';if (this._useDoubleAlternatingStyle) {
top.style.borderBottom = '0px';}
if (scaleBarNumberPosition === ESRI.ADF.UI.ScaleBarNumberPosition.Above) {
top.style.position = 'absolute';top.style.top = (parseInt(barFontSize) + 2) + 'px';}
var left = 0;Array.forEach(arr, function(val, idx) {
var bar = document.createElement('div');bar.style.width = val + '%';var borderHeight = this._useDoubleAlternatingStyle ? 1 : 0;bar.style.height = (height - borderHeight) + 'px';bar.style.position = 'absolute';bar.style.left = left + '%';if (this._useDoubleAlternatingStyle) {
bar.style.borderBottom = '1px solid black';}
left += val;if (idx % 2 === 0) { bar.style.backgroundColor = barColor;} 
top.appendChild(bar);}, this);marks.appendChild(top);return marks;},
_createBottomBar: function(div, scaleBarNumberPosition, barHeight, barFontSize, barColor) {
var bottom = document.createElement('div');bottom.style.width = '100%';var height = Math.ceil(barHeight / 2);bottom.style.height = height + 'px';bottom.style.overflow = 'hidden';bottom.style.border = '1px solid black';bottom.style.borderTop = '0px';if (scaleBarNumberPosition === ESRI.ADF.UI.ScaleBarNumberPosition.Above) {
bottom.style.position = 'absolute';bottom.style.top = (parseInt(height) + parseInt(barFontSize) + 2) + 'px';}
var left = 0;var arr = (this._numberOfDivisions === 8) ? [6.25, 6.25, 6.25, 6.25, 25, 25, 25] : [100];Array.forEach(arr, function(val, idx) {
var bar = document.createElement('div');bar.style.width = val + '%';bar.style.height = (height - 1) + 'px';bar.style.borderTop = '1px solid black';bar.style.position = 'absolute';bar.style.left = left + '%';left += val;if (idx % 2 == 1) { bar.style.backgroundColor = barColor;} 
bottom.appendChild(bar);}, this);div.appendChild(bottom);},
_getScaleForGeographic: function(extent, pxSize) {
var center = extent.get_center();var y = center.get_y();if (Math.abs(y) > 90) { return 0;}
var ps = Math.cos(y * this._toRadians) * pxSize * this._degreeDist;return ps;}
};ESRI.ADF.UI._ScaleBarRendererBase.registerClass('ESRI.ADF.UI._ScaleBarRendererBase');ESRI.ADF.UI._AlternatingStyleRenderer = function(props) {
ESRI.ADF.UI._AlternatingStyleRenderer.initializeBase(this, [props]);};ESRI.ADF.UI._AlternatingStyleRenderer.prototype = {
create: function(containerDiv) {
ESRI.ADF.UI._AlternatingStyleRenderer.callBaseMethod(this, '_create', [containerDiv]);},
onExtentChanged: function(sender, args) {
return ESRI.ADF.UI._AlternatingStyleRenderer.callBaseMethod(this, '_onExtentChanged', [sender, args]);},
dispose: function() {
ESRI.ADF.UI._AlternatingStyleRenderer.callBaseMethod(this, '_dispose');}
};ESRI.ADF.UI._AlternatingStyleRenderer.registerClass('ESRI.ADF.UI._AlternatingStyleRenderer', ESRI.ADF.UI._ScaleBarRendererBase, ESRI.ADF.UI._IScaleBarRenderer);ESRI.ADF.UI._DoubleAlternatingStyleRenderer = function(props) {
ESRI.ADF.UI._DoubleAlternatingStyleRenderer.initializeBase(this, [props]);};ESRI.ADF.UI._DoubleAlternatingStyleRenderer.prototype = {
create: function(containerDiv) {
ESRI.ADF.UI._DoubleAlternatingStyleRenderer.callBaseMethod(this, '_create', [containerDiv]);},
onExtentChanged: function(sender, args) {
return ESRI.ADF.UI._DoubleAlternatingStyleRenderer.callBaseMethod(this, '_onExtentChanged', [sender, args]);},
dispose: function() {
ESRI.ADF.UI._DoubleAlternatingStyleRenderer.callBaseMethod(this, '_dispose');}
};ESRI.ADF.UI._DoubleAlternatingStyleRenderer.registerClass('ESRI.ADF.UI._DoubleAlternatingStyleRenderer', ESRI.ADF.UI._ScaleBarRendererBase, ESRI.ADF.UI._IScaleBarRenderer);ESRI.ADF.UI._SingleDivisionStyleRenderer = function(props) {
ESRI.ADF.UI._SingleDivisionStyleRenderer.initializeBase(this, [props]);}
ESRI.ADF.UI._SingleDivisionStyleRenderer.prototype = {
create: function(containerDiv) {
ESRI.ADF.UI._SingleDivisionStyleRenderer.callBaseMethod(this, '_create', [containerDiv]);},
onExtentChanged: function(sender, args) {
var extent = args.extent;var pixelSize = args.pixelSize;var maxWidth = args.maxWidth;var val = ESRI.ADF.UI._SingleDivisionStyleRenderer.callBaseMethod(this, '_getBestEstimateOfValue', [extent, pixelSize, maxWidth]);this._marksDiv.style.display = val.rounded === 0 ? 'none' : '';if (this._currentPixelSize === val.pixelSize) {
return;}
this._currentPixelSize = val.pixelSize;ESRI.ADF.UI._SingleDivisionStyleRenderer.callBaseMethod(this, '_setLabelText', [this._textbars[0], val.rounded, val.unit]);var width = val.rounded / val.pixelSize;if (width > 0) { this._containerDiv.style.width = (Math.round(width) + 'px');}
else { this._containerDiv.style.width = maxWidth + 'px';}
return width;},
dispose: function() {
ESRI.ADF.UI._SingleDivisionStyleRenderer.callBaseMethod(this, '_dispose');}
};ESRI.ADF.UI._SingleDivisionStyleRenderer.registerClass('ESRI.ADF.UI._SingleDivisionStyleRenderer', ESRI.ADF.UI._ScaleBarRendererBase, ESRI.ADF.UI._IScaleBarRenderer);ESRI.ADF.UI._ScaleLineStyleRenderer = function(props) {
this._barDiv = null;this._leftDiv = null;this._rightDiv = null;this._scaleLineWidth = 2;ESRI.ADF.UI._ScaleLineStyleRenderer.initializeBase(this, [props]);};ESRI.ADF.UI._ScaleLineStyleRenderer.prototype = {
create: function(containerDiv) {
this._containerDiv = containerDiv;var div = document.createElement('div');div.style.position = 'absolute';div.style.left = '0px';div.style.width = this._scaleLineWidth + 'px';div.style.top = '0px';div.style.height = (this._barFontSize + this._scaleLineWidth + 2) + 'px';div.style.backgroundColor = this._barColor;if (ESRI.ADF.System.__isIE6) {
div.style.overflow = 'hidden';}
this._leftDiv = div;containerDiv.appendChild(div);div = document.createElement('div');div.style.position = 'absolute';div.style.left = this._scaleLineWidth + 'px';div.style.height = this._scaleLineWidth + 'px';div.style.width = '100%';div.style.top = this._scaleBarNumberPosition == ESRI.ADF.UI.ScaleBarNumberPosition.Above ? (this._barFontSize + 2) + 'px' : '0px';div.style.backgroundColor = this._barColor;if (ESRI.ADF.System.__isIE6) {
div.style.overflow = 'hidden';}
this._barDiv = div;containerDiv.appendChild(div);div = document.createElement('div');div.style.position = 'absolute';div.style.left = '10px';div.style.height = '4px';div.style.width = '100%';div.style.top = this._scaleBarNumberPosition == ESRI.ADF.UI.ScaleBarNumberPosition.Above ? '0px' : '6px';div.style.color = this._foreColor;div.style.fontSize = this._barFontSize + 'px';this._textbars = [];this._textbars[0] = div;containerDiv.appendChild(div);div = document.createElement('div');div.style.position = 'absolute';div.style.left = '5px';div.style.width = this._scaleLineWidth + 'px';div.style.top = '0px';div.style.height = (this._barFontSize + this._scaleLineWidth + 2) + 'px';div.style.backgroundColor = this._barColor;if (ESRI.ADF.System.__isIE6) {
div.style.overflow = 'hidden';}
this._rightDiv = div;containerDiv.appendChild(div);},
onExtentChanged: function(sender, args) {
var extent = args.extent;var pixelSize = args.pixelSize;var maxWidth = args.maxWidth;var val = ESRI.ADF.UI._ScaleLineStyleRenderer.callBaseMethod(this, '_getBestEstimateOfValue', [extent, pixelSize, maxWidth]);this._barDiv.style.display = this._rightDiv.style.display = this._leftDiv.style.display = val.rounded === 0 ? 'none' : '';if (this._currentPixelSize === val.pixelSize) {
return;}
this._currentPixelSize = val.pixelSize;ESRI.ADF.UI._ScaleLineStyleRenderer.callBaseMethod(this, '_setLabelText', [this._textbars[0], val.rounded, val.unit]);var width = val.rounded / val.pixelSize;if (width > 0) {
this._barDiv.style.width = Math.round(width) + 'px';this._rightDiv.style.left = Math.round(width) + 'px';}
else { this._containerDiv.style.width = maxWidth + 'px';}
return width;},
dispose: function() {
this._leftDiv = null;this._rightDiv = null;this._barDiv = null;ESRI.ADF.UI._ScaleLineStyleRenderer.callBaseMethod(this, '_dispose');}
};ESRI.ADF.UI._ScaleLineStyleRenderer.registerClass('ESRI.ADF.UI._ScaleLineStyleRenderer', ESRI.ADF.UI._ScaleBarRendererBase, ESRI.ADF.UI._IScaleBarRenderer);ESRI.ADF.UI.ScaleBar = function(element) {
ESRI.ADF.UI.ScaleBar.initializeBase(this, [element]);this._earthRadius = 6378137;this._width = null;this._map = null;this._mainbar = null;this._containerDiv = null;this._displayUnit = ESRI.ADF.UI.ScaleBarUnits.Kilometers;this._mapUnit = null;this._height = null;this._serverWidth = null;this._backColor = null;this._barColor = 'black';this._foreColor = 'black';this._currentBarWidth = null;this._barHeight = null;this._scaleBarStyle = ESRI.ADF.UI.ScaleBarStyle.Alternating;this._scaleBarRenderer = new ESRI.ADF.UI._AlternatingStyleRenderer();this._scaleBarNumberPosition = ESRI.ADF.UI.ScaleBarNumberPosition.Above;this._scaleBarUnitConversionGroup = ESRI.ADF.UI.ScaleBarUnitConversionGroup.MilesFeet;this._barFontSize = 10;this._significantDigits = -1;this._labelText = '';};ESRI.ADF.UI.ScaleBar.prototype = {
initialize: function() {
ESRI.ADF.UI.ScaleBar.callBaseMethod(this, 'initialize');if (this._map === null) { throw Error.argumentNull('map');}
if (this._mapUnit === null) { throw Error.argumentNull('mapUnit');}
if (this._width === null) {
this._width = (this._serverWidth === null) ? parseInt(this.get_element().clientWidth, 10) : this._serverWidth;}
if (this._height === null) {
var tmp = this.get_element().style.fontSize;this.get_element().style.fontSize = '0';this._height = parseInt(this.get_element().clientHeight, 10);if (this._height % 2 === 1) { this._height++;} 
this.get_element().style.fontSize = tmp;}
var props = { "scaleBarNumberPosition": this._scaleBarNumberPosition, "foreColor": this._foreColor, "barColor": this._barColor, "barHeight": this._barHeight, "barFontSize": this._barFontSize, "labelText": this._labelText, "mapUnit": this._mapUnit, "displayUnit": this._displayUnit, "significantDigits": this._significantDigits, "scaleBarUnitConversionGroup": this._scaleBarUnitConversionGroup, "labelText": this._labelText };switch (this._scaleBarStyle) {
case ESRI.ADF.UI.ScaleBarStyle.Alternating:
props.numberOfDivisions = 8;props.useDoubleAlternatingStyle = false;this._scaleBarRenderer = new ESRI.ADF.UI._AlternatingStyleRenderer(props);break;case ESRI.ADF.UI.ScaleBarStyle.DoubleAlternating:
props.numberOfDivisions = 8;props.useDoubleAlternatingStyle = true;this._scaleBarRenderer = new ESRI.ADF.UI._DoubleAlternatingStyleRenderer(props);break;case ESRI.ADF.UI.ScaleBarStyle.SingleDivision:
props.numberOfDivisions = 1;props.useDoubleAlternatingStyle = false;this._scaleBarRenderer = new ESRI.ADF.UI._SingleDivisionStyleRenderer(props);break;case ESRI.ADF.UI.ScaleBarStyle.ScaleLine:
props.numberOfDivisions = 1;this._scaleBarRenderer = new ESRI.ADF.UI._ScaleLineStyleRenderer(props);break;}
this._createScaleBar();this._extentChangedHandler = Function.createDelegate(this, this._updateScaleBar);this._map.add_extentChanging(this._extentChangedHandler);this._map.add_extentChanged(this._extentChangedHandler);this._updateScaleBar(this._map);},
dispose: function() {
if (this._extentChangedHandler && this._map) {
this._map.remove_extentChanging(this._extentChangedHandler);this._map.remove_extentChanged(this._extentChangedHandler);}
this._extentChangedHandler = null;this._map = null;this._mainbar = null;this._containerDiv = null;this.get_element().innerHTML = '';if (this._scaleBarRenderer != null) {
this._scaleBarRenderer.dispose();this._scaleBarRenderer = null;}
ESRI.ADF.UI.ScaleBar.callBaseMethod(this, 'dispose');},
_createScaleBar: function() {
if (Sys.Browser.agent !== Sys.Browser.InternetExplorer) {
this.get_element().style.overflow = 'visible';}
this.get_element().style.width = this._serverWidth + 'px';if (this._backColor) {
this.get_element().style.backgroundColor = this._backColor;}
this._containerDiv = document.createElement('div');this._containerDiv.style.width = this._width + 'px';this._containerDiv.style.position = 'relative';this._mainbar = document.createElement('div');this._mainbar.style.width = '100%';this._mainbar.style.position = 'relative';this._mainbar.fontSize = '10px';this._scaleBarRenderer.create(this._mainbar);this._containerDiv.appendChild(this._mainbar);this.get_element().appendChild(this._containerDiv);},
_updateScaleBar: function(sender) {
if (!sender) { return;} 
var extent = null;if (this._mapUnit === ESRI.ADF.UI.ScaleBarUnits.DecimalDegrees) {
extent = sender.get_extent();}
var maxWidth = this._width - 10;this._currentBarWidth = this._scaleBarRenderer.onExtentChanged(this, { "extent": extent, "pixelSize": sender.get_pixelSize(), "maxWidth": maxWidth });var handler = this.get_events().getHandler('scaleChanged');if (handler) { handler(this, this._currentBarWidth);}
},
__refresh: function() {
if (this._scaleBarRenderer) {
this._scaleBarRenderer.dispose();}
this.get_element().removeChild(this._containerDiv);this._createScaleBar();if (this._map) { this._updateScaleBar(this._map);}
},
get_scaleBarWidth: function() {
return this._currentBarWidth;},
get_map: function() {
return this._map;},
set_map: function(value) { this._map = value;},
get_mapUnit: function() {
return this._mapUnit;},
set_mapUnit: function(value) {
if (typeof (value) === 'string') { value = eval(value);}
this._mapUnit = value;if (this._scaleBarRenderer != null) {
this._scaleBarRenderer._mapUnit = value;}
},
get_displayUnit: function() {
return this._displayUnit;},
set_displayUnit: function(value) {
if (typeof (value) === 'string') { value = eval(value);}
if (this._displayUnit != value) {
if (value === ESRI.ADF.UI.ScaleBarUnits.DecimalDegrees) {
throw Error.argument("displayUnit", "DecimalDegrees is not a valid display unit");}
this._displayUnit = value;if (this._scaleBarRenderer != null) {
this._scaleBarRenderer._displayUnit = value;}
if (this._map) { this._updateScaleBar(this._map);}
}
},
get_earthRadius: function() {
return this._earthRadius;},
set_earthRadius: function(value) {
this._earthRadius = value;if (this._scaleBarRenderer != null) {
this._scaleBarRenderer._earthRadius = value;this._scaleBarRenderer._degreeDist = value * this._toRadians;}
},
get_barColor: function() {
return this._barColor;},
set_barColor: function(value) { this._barColor = value;},
get_scaleBarStyle: function() {
return this._scaleBarStyle;},
set_scaleBarStyle: function(value) {
if (typeof (value) === 'string') { value = eval(value);}
this._scaleBarStyle = value;},
get_scaleBarNumberPosition: function() {
return this._scaleBarNumberPosition;},
set_scaleBarNumberPosition: function(value) {
if (typeof (value) === 'string') { value = eval(value);}
this._scaleBarNumberPosition = value;},
get_barFontSize: function() {
return this._barFontSize;},
set_barFontSize: function(value) {
this._barFontSize = parseFloat(value);},
get_foreColor: function() {
return this._foreColor;},
set_foreColor: function(value) {
this._foreColor = value;},
get_serverWidth: function() {
return this._serverWidth;},
set_serverWidth: function(value) {
this._serverWidth = parseInt(value);},
get_backColor: function() {
return this._backColor;},
set_backColor: function(value) {
this._backColor = value;},
get_barHeight: function() {
return this._barHeight;},
set_barHeight: function(value) {
this._barHeight = value;},
get_significantDigits: function() {
return this._significantDigits;},
set_significantDigits: function(value) {
this._significantDigits = value;},
get_scaleBarUnitConversionGroup: function() {
return this._scaleBarUnitConversionGroup;},
set_scaleBarUnitConversionGroup: function(value) {
if (typeof (value) === 'string') { value = eval(value);}
this._scaleBarUnitConversionGroup = value;},
get_labelText: function() {
return this._labelText;},
set_labelText: function(value) {
this._labelText = value;},
add_scaleChanged: function(handler) {
this.get_events().addHandler('scaleChanged', handler);},
remove_scaleChanged: function(handler) { this.get_events().removeHandler('scaleChanged', handler);}
};ESRI.ADF.UI.ScaleBar.registerClass('ESRI.ADF.UI.ScaleBar', Sys.UI.Control);
//END ESRI.ArcGIS.ADF.Web.UI.WebControls.Runtime.JavaScript.ESRI.ADF.UI.ScaleBar.release.js
//START AjaxControlToolkit.Compat.DragDrop.DragDropScripts.js
Type.registerNamespace("AjaxControlToolkit");AjaxControlToolkit.IDragSource=function(){};AjaxControlToolkit.IDragSource.prototype={get_dragDataType:function(){throw Error.notImplemented()},getDragData:function(){throw Error.notImplemented()},get_dragMode:function(){throw Error.notImplemented()},onDragStart:function(){throw Error.notImplemented()},onDrag:function(){throw Error.notImplemented()},onDragEnd:function(){throw Error.notImplemented()}};AjaxControlToolkit.IDragSource.registerInterface("AjaxControlToolkit.IDragSource");AjaxControlToolkit.IDropTarget=function(){};AjaxControlToolkit.IDropTarget.prototype={get_dropTargetElement:function(){throw Error.notImplemented()},canDrop:function(){throw Error.notImplemented()},drop:function(){throw Error.notImplemented()},onDragEnterTarget:function(){throw Error.notImplemented()},onDragLeaveTarget:function(){throw Error.notImplemented()},onDragInTarget:function(){throw Error.notImplemented()}};AjaxControlToolkit.IDropTarget.registerInterface("AjaxControlToolkit.IDropTarget");AjaxControlToolkit.DragMode=function(){throw Error.invalidOperation()};AjaxControlToolkit.DragMode.prototype={Copy:0,Move:1};AjaxControlToolkit.DragMode.registerEnum("AjaxControlToolkit.DragMode");AjaxControlToolkit.DragDropEventArgs=function(c,a,b){this._dragMode=c;this._dataType=a;this._data=b};AjaxControlToolkit.DragDropEventArgs.prototype={get_dragMode:function(){return this._dragMode||null},get_dragDataType:function(){return this._dataType||null},get_dragData:function(){return this._data||null}};AjaxControlToolkit.DragDropEventArgs.registerClass("AjaxControlToolkit.DragDropEventArgs");AjaxControlToolkit._DragDropManager=function(){this._instance=null;this._events=null};AjaxControlToolkit._DragDropManager.prototype={add_dragStart:function(a){this.get_events().addHandler("dragStart",a)},remove_dragStart:function(a){this.get_events().removeHandler("dragStart",a)},get_events:function(){if(!this._events)this._events=new Sys.EventHandlerList;return this._events},add_dragStop:function(a){this.get_events().addHandler("dragStop",a)},remove_dragStop:function(a){this.get_events().removeHandler("dragStop",a)},_getInstance:function(){var a=this;if(!a._instance){if(Sys.Browser.agent===Sys.Browser.InternetExplorer)a._instance=new AjaxControlToolkit.IEDragDropManager;else a._instance=new AjaxControlToolkit.GenericDragDropManager;a._instance.initialize();a._instance.add_dragStart(Function.createDelegate(a,a._raiseDragStart));a._instance.add_dragStop(Function.createDelegate(a,a._raiseDragStop))}return a._instance},startDragDrop:function(b,c,d,a){this._getInstance().startDragDrop(b,c,d,a)},registerDropTarget:function(a){this._getInstance().registerDropTarget(a)},unregisterDropTarget:function(a){this._getInstance().unregisterDropTarget(a)},dispose:function(){delete this._events;Sys.Application.unregisterDisposableObject(this);Sys.Application.removeComponent(this)},_raiseDragStart:function(c,b){var a=this.get_events().getHandler("dragStart");if(a)a(this,b)},_raiseDragStop:function(c,b){var a=this.get_events().getHandler("dragStop");if(a)a(this,b)}};AjaxControlToolkit._DragDropManager.registerClass("AjaxControlToolkit._DragDropManager");AjaxControlToolkit.DragDropManager=new AjaxControlToolkit._DragDropManager;AjaxControlToolkit.IEDragDropManager=function(){var b=null,a=this;AjaxControlToolkit.IEDragDropManager.initializeBase(a);a._dropTargets=b;a._radius=10;a._useBuiltInDragAndDropFunctions=true;a._activeDragVisual=b;a._activeContext=b;a._activeDragSource=b;a._underlyingTarget=b;a._oldOffset=b;a._potentialTarget=b;a._isDragging=false;a._mouseUpHandler=b;a._documentMouseMoveHandler=b;a._documentDragOverHandler=b;a._dragStartHandler=b;a._mouseMoveHandler=b;a._dragEnterHandler=b;a._dragLeaveHandler=b;a._dragOverHandler=b;a._dropHandler=b};AjaxControlToolkit.IEDragDropManager.prototype={add_dragStart:function(a){this.get_events().addHandler("dragStart",a)},remove_dragStart:function(a){this.get_events().removeHandler("dragStart",a)},add_dragStop:function(a){this.get_events().addHandler("dragStop",a)},remove_dragStop:function(a){this.get_events().removeHandler("dragStop",a)},initialize:function(){var a=this;AjaxControlToolkit.IEDragDropManager.callBaseMethod(a,"initialize");a._mouseUpHandler=Function.createDelegate(a,a._onMouseUp);a._documentMouseMoveHandler=Function.createDelegate(a,a._onDocumentMouseMove);a._documentDragOverHandler=Function.createDelegate(a,a._onDocumentDragOver);a._dragStartHandler=Function.createDelegate(a,a._onDragStart);a._mouseMoveHandler=Function.createDelegate(a,a._onMouseMove);a._dragEnterHandler=Function.createDelegate(a,a._onDragEnter);a._dragLeaveHandler=Function.createDelegate(a,a._onDragLeave);a._dragOverHandler=Function.createDelegate(a,a._onDragOver);a._dropHandler=Function.createDelegate(a,a._onDrop)},dispose:function(){var a=this;if(a._dropTargets){for(var b=0;b<a._dropTargets;b++)a.unregisterDropTarget(a._dropTargets[b]);a._dropTargets=null}AjaxControlToolkit.IEDragDropManager.callBaseMethod(a,"dispose")},startDragDrop:function(c,b,h,f){var a=this,j=window._event;if(a._isDragging)return;a._underlyingTarget=null;a._activeDragSource=c;a._activeDragVisual=b;a._activeContext=h;a._useBuiltInDragAndDropFunctions=typeof f!="unefined"?f:true;var g={x:j.clientX,y:j.clientY};b.originalPosition=b.style.position;b.style.position="absolute";document._lastPosition=g;b.startingPoint=g;var k=a.getScrollOffset(b,true);b.startingPoint=a.addPoints(b.startingPoint,k);var d=parseInt(b.style.left),e=parseInt(b.style.top);if(isNaN(d))d="0";if(isNaN(e))e="0";b.startingPoint=a.subtractPoints(b.startingPoint,{x:d,y:e});a._prepareForDomChanges();c.onDragStart();var l=new AjaxControlToolkit.DragDropEventArgs(c.get_dragMode(),c.get_dragDataType(),c.getDragData(h)),i=a.get_events().getHandler("dragStart");if(i)i(a,l);a._recoverFromDomChanges();a._wireEvents();a._drag(true)},_stopDragDrop:function(c){var b=null,a=this,e=window._event;if(a._activeDragSource!=b){a._unwireEvents();if(!c)c=a._underlyingTarget==b;if(!c&&a._underlyingTarget!=b)a._underlyingTarget.drop(a._activeDragSource.get_dragMode(),a._activeDragSource.get_dragDataType(),a._activeDragSource.getDragData(a._activeContext));a._activeDragSource.onDragEnd(c);var d=a.get_events().getHandler("dragStop");if(d)d(a,Sys.EventArgs.Empty);a._activeDragVisual.style.position=a._activeDragVisual.originalPosition;a._activeDragSource=b;a._activeContext=b;a._activeDragVisual=b;a._isDragging=false;a._potentialTarget=b;e.preventDefault()}},_drag:function(g){var b=null,a=this,f=window._event,e={x:f.clientX,y:f.clientY};document._lastPosition=e;var h=a.getScrollOffset(a._activeDragVisual,true),c=a.addPoints(a.subtractPoints(e,a._activeDragVisual.startingPoint),h);if(!g&&parseInt(a._activeDragVisual.style.left)==c.x&&parseInt(a._activeDragVisual.style.top)==c.y)return;$common.setLocation(a._activeDragVisual,c);a._prepareForDomChanges();a._activeDragSource.onDrag();a._recoverFromDomChanges();a._potentialTarget=a._findPotentialTarget(a._activeDragSource,a._activeDragVisual);var d=a._potentialTarget!=a._underlyingTarget||a._potentialTarget==b;if(d&&a._underlyingTarget!=b)a._leaveTarget(a._activeDragSource,a._underlyingTarget);if(a._potentialTarget!=b)if(d){a._underlyingTarget=a._potentialTarget;a._enterTarget(a._activeDragSource,a._underlyingTarget)}else a._moveInTarget(a._activeDragSource,a._underlyingTarget);else a._underlyingTarget=b},_wireEvents:function(){var b="mousemove",a=this;if(a._useBuiltInDragAndDropFunctions){$addHandler(document,"mouseup",a._mouseUpHandler);$addHandler(document,b,a._documentMouseMoveHandler);$addHandler(document.body,"dragover",a._documentDragOverHandler);$addHandler(a._activeDragVisual,"dragstart",a._dragStartHandler);$addHandler(a._activeDragVisual,"dragend",a._mouseUpHandler);$addHandler(a._activeDragVisual,"drag",a._mouseMoveHandler)}else{$addHandler(document,"mouseup",a._mouseUpHandler);$addHandler(document,b,a._mouseMoveHandler)}},_unwireEvents:function(){var b="mousemove",a=this;if(a._useBuiltInDragAndDropFunctions){$removeHandler(a._activeDragVisual,"drag",a._mouseMoveHandler);$removeHandler(a._activeDragVisual,"dragend",a._mouseUpHandler);$removeHandler(a._activeDragVisual,"dragstart",a._dragStartHandler);$removeHandler(document.body,"dragover",a._documentDragOverHandler);$removeHandler(document,b,a._documentMouseMoveHandler);$removeHandler(document,"mouseup",a._mouseUpHandler)}else{$removeHandler(document,b,a._mouseMoveHandler);$removeHandler(document,"mouseup",a._mouseUpHandler)}},registerDropTarget:function(b){var a=this;if(a._dropTargets==null)a._dropTargets=[];Array.add(a._dropTargets,b);a._wireDropTargetEvents(b)},unregisterDropTarget:function(a){this._unwireDropTargetEvents(a);if(this._dropTargets)Array.remove(this._dropTargets,a)},_wireDropTargetEvents:function(c){var b=this,a=c.get_dropTargetElement();a._dropTarget=c;$addHandler(a,"dragenter",b._dragEnterHandler);$addHandler(a,"dragleave",b._dragLeaveHandler);$addHandler(a,"dragover",b._dragOverHandler);$addHandler(a,"drop",b._dropHandler)},_unwireDropTargetEvents:function(c){var b=this,a=c.get_dropTargetElement();if(a._dropTarget){a._dropTarget=null;$removeHandler(a,"dragenter",b._dragEnterHandler);$removeHandler(a,"dragleave",b._dragLeaveHandler);$removeHandler(a,"dragover",b._dragOverHandler);$removeHandler(a,"drop",b._dropHandler)}},_onDragStart:function(d){window._event=d;document.selection.empty();var c=d.dataTransfer;if(!c&&d.rawEvent)c=d.rawEvent.dataTransfer;var b=this._activeDragSource.get_dragDataType().toLowerCase(),a=this._activeDragSource.getDragData(this._activeContext);if(a){if(b!="text"&&b!="url"){b="text";if(a.innerHTML!=null)a=a.innerHTML}c.effectAllowed="move";c.setData(b,a.toString())}},_onMouseUp:function(a){window._event=a;this._stopDragDrop(false)},_onDocumentMouseMove:function(a){window._event=a;this._dragDrop()},_onDocumentDragOver:function(a){window._event=a;if(this._potentialTarget)a.preventDefault()},_onMouseMove:function(a){window._event=a;this._drag()},_onDragEnter:function(c){window._event=c;if(this._isDragging)c.preventDefault();else{var b=AjaxControlToolkit.IEDragDropManager._getDataObjectsForDropTarget(this._getDropTarget(c.target));for(var a=0;a<b.length;a++)this._dropTarget.onDragEnterTarget(AjaxControlToolkit.DragMode.Copy,b[a].type,b[a].value)}},_onDragLeave:function(c){window._event=c;if(this._isDragging)c.preventDefault();else{var b=AjaxControlToolkit.IEDragDropManager._getDataObjectsForDropTarget(this._getDropTarget(c.target));for(var a=0;a<b.length;a++)this._dropTarget.onDragLeaveTarget(AjaxControlToolkit.DragMode.Copy,b[a].type,b[a].value)}},_onDragOver:function(c){window._event=c;if(this._isDragging)c.preventDefault();else{var b=AjaxControlToolkit.IEDragDropManager._getDataObjectsForDropTarget(this._getDropTarget(c.target));for(var a=0;a<b.length;a++)this._dropTarget.onDragInTarget(AjaxControlToolkit.DragMode.Copy,b[a].type,b[a].value)}},_onDrop:function(c){window._event=c;if(!this._isDragging){var b=AjaxControlToolkit.IEDragDropManager._getDataObjectsForDropTarget(this._getDropTarget(c.target));for(var a=0;a<b.length;a++)this._dropTarget.drop(AjaxControlToolkit.DragMode.Copy,b[a].type,b[a].value)}c.preventDefault()},_getDropTarget:function(a){while(a){if(a._dropTarget!=null)return a._dropTarget;a=a.parentNode}return null},_dragDrop:function(){if(this._isDragging)return;this._isDragging=true;this._activeDragVisual.dragDrop();document.selection.empty()},_moveInTarget:function(a,b){this._prepareForDomChanges();b.onDragInTarget(a.get_dragMode(),a.get_dragDataType(),a.getDragData(this._activeContext));this._recoverFromDomChanges()},_enterTarget:function(a,b){this._prepareForDomChanges();b.onDragEnterTarget(a.get_dragMode(),a.get_dragDataType(),a.getDragData(this._activeContext));this._recoverFromDomChanges()},_leaveTarget:function(a,b){this._prepareForDomChanges();b.onDragLeaveTarget(a.get_dragMode(),a.get_dragDataType(),a.getDragData(this._activeContext));this._recoverFromDomChanges()},_findPotentialTarget:function(c){var a=this,f=window._event;if(a._dropTargets==null)return null;var j=c.get_dragDataType(),i=c.get_dragMode(),h=c.getDragData(a._activeContext),d=a.getScrollOffset(document.body,true),k=f.clientX+d.x,l=f.clientY+d.y,g={x:k-a._radius,y:l-a._radius,width:a._radius*2,height:a._radius*2},e;for(var b=0;b<a._dropTargets.length;b++){e=$common.getBounds(a._dropTargets[b].get_dropTargetElement());if($common.overlaps(g,e)&&a._dropTargets[b].canDrop(i,j,h))return a._dropTargets[b]}return null},_prepareForDomChanges:function(){this._oldOffset=$common.getLocation(this._activeDragVisual)},_recoverFromDomChanges:function(){var a=this,b=$common.getLocation(a._activeDragVisual);if(a._oldOffset.x!=b.x||a._oldOffset.y!=b.y){a._activeDragVisual.startingPoint=a.subtractPoints(a._activeDragVisual.startingPoint,a.subtractPoints(a._oldOffset,b));scrollOffset=a.getScrollOffset(a._activeDragVisual,true);var c=a.addPoints(a.subtractPoints(document._lastPosition,a._activeDragVisual.startingPoint),scrollOffset);$common.setLocation(a._activeDragVisual,c)}},addPoints:function(a,b){return {x:a.x+b.x,y:a.y+b.y}},subtractPoints:function(a,b){return {x:a.x-b.x,y:a.y-b.y}},getScrollOffset:function(b,e){var c=b.scrollLeft,d=b.scrollTop;if(e){var a=b.parentNode;while(a!=null&&a.scrollLeft!=null){c+=a.scrollLeft;d+=a.scrollTop;if(a==document.body&&(c!=0&&d!=0))break;a=a.parentNode}}return {x:c,y:d}},getBrowserRectangle:function(){var b=window.innerWidth,a=window.innerHeight;if(b==null)b=document.documentElement.clientWidth;if(a==null)a=document.documentElement.clientHeight;return {x:0,y:0,width:b,height:a}},getNextSibling:function(a){for(a=a.nextSibling;a!=null;a=a.nextSibling)if(a.innerHTML!=null)return a;return null},hasParent:function(a){return a.parentNode!=null&&a.parentNode.tagName!=null}};AjaxControlToolkit.IEDragDropManager.registerClass("AjaxControlToolkit.IEDragDropManager",Sys.Component);AjaxControlToolkit.IEDragDropManager._getDataObjectsForDropTarget=function(g){if(g==null)return [];var e=window._event,f=[],b=["URL","Text"],c;for(var a=0;a<b.length;a++){var d=e.dataTransfer;if(!d&&e.rawEvent)d=e.rawEvent.dataTransfer;c=d.getData(b[a]);if(g.canDrop(AjaxControlToolkit.DragMode.Copy,b[a],c))if(c)Array.add(f,{type:b[a],value:c})}return f};AjaxControlToolkit.GenericDragDropManager=function(){var b=null,a=this;AjaxControlToolkit.GenericDragDropManager.initializeBase(a);a._dropTargets=b;a._scrollEdgeConst=40;a._scrollByConst=10;a._scroller=b;a._scrollDeltaX=0;a._scrollDeltaY=0;a._activeDragVisual=b;a._activeContext=b;a._activeDragSource=b;a._oldOffset=b;a._potentialTarget=b;a._mouseUpHandler=b;a._mouseMoveHandler=b;a._keyPressHandler=b;a._scrollerTickHandler=b};AjaxControlToolkit.GenericDragDropManager.prototype={initialize:function(){var a=this;AjaxControlToolkit.GenericDragDropManager.callBaseMethod(a,"initialize");a._mouseUpHandler=Function.createDelegate(a,a._onMouseUp);a._mouseMoveHandler=Function.createDelegate(a,a._onMouseMove);a._keyPressHandler=Function.createDelegate(a,a._onKeyPress);a._scrollerTickHandler=Function.createDelegate(a,a._onScrollerTick);if(Sys.Browser.agent===Sys.Browser.Safari)AjaxControlToolkit.GenericDragDropManager.__loadSafariCompatLayer(a);a._scroller=new Sys.Timer;a._scroller.set_interval(10);a._scroller.add_tick(a._scrollerTickHandler)},startDragDrop:function(b,c,d){var a=this;a._activeDragSource=b;a._activeDragVisual=c;a._activeContext=d;AjaxControlToolkit.GenericDragDropManager.callBaseMethod(a,"startDragDrop",[b,c,d])},_stopDragDrop:function(a){this._scroller.set_enabled(false);AjaxControlToolkit.GenericDragDropManager.callBaseMethod(this,"_stopDragDrop",[a])},_drag:function(a){AjaxControlToolkit.GenericDragDropManager.callBaseMethod(this,"_drag",[a]);this._autoScroll()},_wireEvents:function(){$addHandler(document,"mouseup",this._mouseUpHandler);$addHandler(document,"mousemove",this._mouseMoveHandler);$addHandler(document,"keypress",this._keyPressHandler)},_unwireEvents:function(){$removeHandler(document,"keypress",this._keyPressHandler);$removeHandler(document,"mousemove",this._mouseMoveHandler);$removeHandler(document,"mouseup",this._mouseUpHandler)},_wireDropTargetEvents:function(){},_unwireDropTargetEvents:function(){},_onMouseUp:function(a){window._event=a;this._stopDragDrop(false)},_onMouseMove:function(a){window._event=a;this._drag()},_onKeyPress:function(a){window._event=a;var b=a.keyCode?a.keyCode:a.rawEvent.keyCode;if(b==27)this._stopDragDrop(true)},_autoScroll:function(){var a=this,c=window._event,b=a.getBrowserRectangle();if(b.width>0){a._scrollDeltaX=a._scrollDeltaY=0;if(c.clientX<b.x+a._scrollEdgeConst)a._scrollDeltaX=-a._scrollByConst;else if(c.clientX>b.width-a._scrollEdgeConst)a._scrollDeltaX=a._scrollByConst;if(c.clientY<b.y+a._scrollEdgeConst)a._scrollDeltaY=-a._scrollByConst;else if(c.clientY>b.height-a._scrollEdgeConst)a._scrollDeltaY=a._scrollByConst;if(a._scrollDeltaX!=0||a._scrollDeltaY!=0)a._scroller.set_enabled(true);else a._scroller.set_enabled(false)}},_onScrollerTick:function(){var d=document.body.scrollLeft,f=document.body.scrollTop;window.scrollBy(this._scrollDeltaX,this._scrollDeltaY);var c=document.body.scrollLeft,e=document.body.scrollTop,a=this._activeDragVisual,b={x:parseInt(a.style.left)+(c-d),y:parseInt(a.style.top)+(e-f)};$common.setLocation(a,b)}};AjaxControlToolkit.GenericDragDropManager.registerClass("AjaxControlToolkit.GenericDragDropManager",AjaxControlToolkit.IEDragDropManager);if(Sys.Browser.agent===Sys.Browser.Safari)AjaxControlToolkit.GenericDragDropManager.__loadSafariCompatLayer=function(a){a._getScrollOffset=a.getScrollOffset;a.getScrollOffset=function(){return {x:0,y:0}};a._getBrowserRectangle=a.getBrowserRectangle;a.getBrowserRectangle=function(){var b=a._getBrowserRectangle(),c=a._getScrollOffset(document.body,true);return {x:b.x+c.x,y:b.y+c.y,width:b.width+c.x,height:b.height+c.y}}};
//END AjaxControlToolkit.Compat.DragDrop.DragDropScripts.js
//START ESRI.ArcGIS.ADF.Web.UI.WebControls.Runtime.JavaScript.ESRI.ADF.UI.Navigation.release.js
//----------------------------------------------------------
// Copyright (C) ESRI. All rights reserved.
//----------------------------------------------------------
Type.registerNamespace('ESRI.ADF.UI');ESRI.ADF.UI.Navigation = function(element) { 
ESRI.ADF.UI.Navigation.initializeBase(this, [element]);this._intervalRate = 25;this._moveX = 0;this._moveY = 0;this._speed = 3;this._interval = null;this._map = null;this._mouseUpHandler = null;this._mouseMoveHandler = null;this._panning = false;};ESRI.ADF.UI.Navigation.prototype = {
initialize : function() {
ESRI.ADF.UI.Navigation.callBaseMethod(this, 'initialize');var nav = this.get_element();nav.style["-moz-user-focus"]='normal';if (this._map === null)
{
nav.style.display = "none";nav.style.visibility = "hidden";}
else
{
this._mouseUpHandler = Function.createDelegate(this, this._doMouseUp);this._mouseMoveHandler = Function.createDelegate(this, this._doMouseMove);$addHandler(this.get_element(), 'mousedown', Function.createDelegate(this, this._doMouseDown));}
},
dispose : function() {
$clearHandlers(this.get_element());ESRI.ADF.UI.Navigation.callBaseMethod(this, 'dispose');},
_doMouseDown : function (e)
{
if (e.button == Sys.UI.MouseButton.leftButton)
{
if (this._panning === false)
{
this._panning = true;this._calculatePanDirection (e);this._panMap ();$addHandler(this.get_element(), 'mouseup', this._mouseUpHandler);$addHandler(this.get_element(), 'mousemove', this._mouseMoveHandler);$addHandler(document, 'mouseup', this._mouseUpHandler);$addHandler(document, 'mousemove', this._mouseMoveHandler);this._interval = window.setInterval(Function.createDelegate(this, this._panMap), this._intervalRate);}
}
else
{
if (this._panning === true)
{
this._stopPanning();}
}
},
_doMouseMove : function (e)
{
if (this._panning === true)
{
this._calculatePanDirection (e);e.preventDefault();e.stopPropagation();}
},
_doMouseUp : function (e)
{
if (this._panning === true)
{
this._stopPanning();}
},
_stopPanning : function ()
{
this._panning = false;window.clearInterval (this._interval);$removeHandler(this.get_element(), 'mouseup', this._mouseUpHandler);$removeHandler(this.get_element(), 'mousemove', this._mouseMoveHandler);$removeHandler(document, 'mouseup', this._mouseUpHandler);$removeHandler(document, 'mousemove', this._mouseMoveHandler);this._map._doContinuousPan(0, 0);},
_calculatePanDirection : function (e)
{
var bounds = Sys.UI.DomElement.getBounds (this.get_element());var location = Sys.UI.DomElement.getLocation (this.get_element());e = ESRI.ADF.System._makeMouseEventRelativeToElement(e,this.get_element(),location);var centerX = Math.round (bounds.width / 2);var centerY = Math.round (bounds.height / 2);var shiftX = e.offsetX - centerX;var shiftY = e.offsetY - centerY;var shift = (shiftX / shiftY);this._moveX = 0;this._moveY = 0;if (shift === 0)
{
if (shiftY > 0)
{
this._moveY = 1;}
else 
{
this._moveY = -1;}
}
else if (shiftX < 0)
{
if (shift >= 0 && shift <= 0.5)
{
this._moveY = -1;}
else if (shift > 0.5 && shift <= 1.5)
{
this._moveX = -1;this._moveY = -1;}
else if (shift > 1.5 || shift <= -1.5)
{
this._moveX = -1;}
else if (shift > -1.5 && shift <= -0.5)
{
this._moveX = -1;this._moveY = 1;}
else
{
this._moveY = 1;}
}
else {
if (shift >= 0 && shift <= 0.5)
{
this._moveY = 1;}
else if (shift > 0.5 && shift <= 1.5)
{
this._moveX = 1;this._moveY = 1;}
else if (shift > 1.5 || shift <= -1.5)
{
this._moveX = 1;}
else if (shift > -1.5 && shift <= -0.5)
{
this._moveX = 1;this._moveY = -1;}
else
{
this._moveY = -1;}
} 
},
_panMap : function ()
{
if (this._moveX !== 0 || this._moveY !== 0)
{
this._map._doContinuousPan (this._moveX * this._speed, this._moveY * this._speed);}
},
get_map : function ()
{
return this._map;},
set_map : function(value)
{
if (this._map != value) {
this._map = value;this.raisePropertyChanged('map');}
},
get_speed : function ()
{
return this._speed;},
set_speed : function (value)
{
if (this._speed != value) {
this._speed = value;this.raisePropertyChanged('speed');}
}
};ESRI.ADF.UI.Navigation.registerClass('ESRI.ADF.UI.Navigation', Sys.UI.Control);ESRI.ADF.UI.OverviewMap = function(element) { 
ESRI.ADF.UI.OverviewMap.initializeBase(this, [element]);this._map = null;this._width = 0;this._height = 0;this._boxLeft = 0;this._boxTop = 0;this._boxWidth = 0;this._boxHeight = 0;this._imageURL = "";this._blankURL = "";this._tooltip = "";this._boxColor = "Red";this._lineWidth = 3;this._lineType = "solid";this._aoiResizable = true;this._aoiDraggable = true;this._aoiMinWidth = 15;this._aoiMinHeight = 15;this._panMouseUpHandler = null;this._panMouseMoveHandler = null;this._resizeMouseUpHandler = null;this._resizeMouseMoveHandler = null;this._mouseDownOriginX = 0;this._mouseDownOriginY = 0;this._mousePanX = 0;this._mousePanY = 0;this._resizeWidth = 0;this._resizeHeight = 0;this._resizeOriginX = 0;this._resizeOriginY = 0;this._enabled = false;};ESRI.ADF.UI.OverviewMap.prototype = {
initialize : function() {
ESRI.ADF.UI.OverviewMap.callBaseMethod(this, 'initialize');var ovm = this.get_element();if (this._map === null)
{
ovm.style.display = "none";ovm.style.visibility = "hidden";}
else
{
this._enabled = true;this._right = this._width;this._bottom = this._height;this._boxRight = this._boxLeft + this._boxWidth;this._boxBottom = this._boxTop + this._boxHeight;this._aoiResizable = Boolean(this._aoiResizable);this._aoiDraggable = Boolean(this._aoiDraggable);this._divId = "OVDiv_" + this.get_id();this._imageId = "OVImage_" + this.get_id();this._boxDivId = "OVBoxDiv_" + this.get_id();this._boxImageId = "OVBoxImage_" + this.get_id();this._boxResizeDivId = "OVBoxResizeDiv_" + this.get_id();this._boxDivObject = null;this._imageObject = null;this._boxResizeObject = null;this._dragOVBox = false;this._dragOVResizeBox = false;this._mapXRatio = 1;this._mapYRatio = 1;this._mapXYRatio = 1;this._ovPanStartLeft = 0;this._ovPanStartTop = 0;this._createDivs (ovm);}
},
dispose : function() {
$clearHandlers(this._element);ESRI.ADF.UI.OverviewMap.callBaseMethod(this, 'dispose');},
_createDivs : function (ovm)
{
var leftAdjust = 0;var topAdjust = 0;if (this._boxLeft<0) {
leftAdjust = this._boxLeft;this._boxLeft = 0;}
if (this._boxTop<0) {
topAdjust = this._boxTop;this._boxTop = 0;}
if (this._boxLeft + this._boxWidth+(this._lineWidth*2)>=this._width)
{
this._boxWidth = this._width - this._boxLeft-(this._lineWidth*2) + leftAdjust;}
if (this._boxTop + this._boxHeight+(this._lineWidth*2)>=this._height)
{
this._boxHeight = this._height - this._boxTop-(this._lineWidth*2) + topAdjust;}
var s = "";s += '<div id="OVControlDiv_' + this.get_id() + '" style="position: relative; background-color: White; width: ' + this._width + 'px; height: ' + this._height + 'px; overflow:hidden;">\n';s += '<div id="' + this._divId + '" style="position: absolute; left: 0px; top: 0px; background-color: White; width: ' + this._width + 'px; height: ' + this._height + 'px; overflow:hidden;">\n';s += '<img id="' + this._imageId + '" alt="' + this._tooltip + '"  title="' + this._tooltip + '" src="' + this._imageURL + '" width="' + this._width + '" height="' + this._height + '" hspace="0" vspace="0" border="0" />\n';s += '</div>\n';var style = "border: " + this._lineWidth + "px " + this._lineType + " " + this._boxColor + ";";s += '<div id="' + this._boxDivId + '" style="position: absolute; left: ' + this._boxLeft + 'px; top: ' + this._boxTop + 'px;' + style + ' width: ' + this._boxWidth + 'px; height: ' + this._boxHeight + 'px; overflow:hidden; ">\n';s += '<img id="' + this._boxImageId + '" alt="' + this._tooltip + '"  title="' + this._tooltip + '" src="' + this._blankURL + '" width="100%" height="100%" hspace="0" vspace="0" border="0">\n';if (Sys.Browser.agent == Sys.Browser.Firefox)
{
s += '<div style=\"width: 100%; height: 100%; left: 0; top: 0; position: absolute\"></div>';}
s += '</div>\n';if (this._aoiResizable)
{
s += '<div id="' + this._boxResizeDivId + '" style="position: absolute; left: ' + (this._boxLeft + this._boxWidth - 5) + '; top: ' + (this._boxTop + this._boxHeight - 5) + '; cursor: nw-resize; width: 10px; height: 10px; overflow:hidden;">\n';s += '<img  alt="Resize AOI"  title="Resize AOI" src="' + this._blankURL + '" width="10" height="10" hspace="0" vspace="0" border="0" >\n';if (Sys.Browser.agent == Sys.Browser.Firefox)
{
s += '<div style=\"width: 100%; height: 100%; left: 0; top: 0; position: absolute\"></div>';}
s += '</div>\n';}
s += '</div>\n';ovm.innerHTML = s;this._setObjects();this._setEvents();this._updateMapRatio();},
_setObjects : function ()
{
this._divObject = $get(this._divId);this._boxDivObject = $get(this._boxDivId);this._imageObject = $get(this._imageId);if (this._aoiResizable)
{
this._boxResizeObject = $get(this._boxResizeDivId);}
},
_setEvents : function ()
{
if (this._aoiDraggable)
{
this._panMouseUpHandler = Function.createDelegate(this, this._doPanMouseUp);this._panMouseMoveHandler = Function.createDelegate(this, this._doPanMouseMove);this._boxDivObject.style.cursor = "move";this._divObject.style.cursor = "default";$addHandler(this._boxDivObject, 'mousedown', Function.createDelegate(this, this._doPanMouseDown));}
if (this._aoiResizable)
{ 
this._resizeMouseUpHandler = Function.createDelegate(this, this._doResizeMouseUp);this._resizeMouseMoveHandler = Function.createDelegate(this, this._doResizeMouseMove);$addHandler(this._boxResizeObject, 'mousedown', Function.createDelegate(this, this._doResizeMouseDown));}
},
_updateMapRatio : function ()
{
var bounds = Sys.UI.DomElement.getBounds (this._map.get_element());var mapWidth = bounds.width;var mapHeight = bounds.height;this._mapXRatio = mapWidth / this._boxWidth;this._mapYRatio = mapHeight / this._boxHeight;this._mapXYRatio = mapWidth / mapHeight;if (this._mapXYRatio > 1)
{
this._maxBoxWidth = this._width;this._maxBoxHeight = this._width / this._mapXYRatio;}
else
{
this._maxBoxWidth = this._height * this._mapXYRatio;this._maxBoxHeight = this._height;}
this._maxBoxWidth = Math.min(this._width, this._maxBoxWidth);this._maxBoxHeight = Math.min(this._height, this._maxBoxHeight);},
_doPanMouseDown : function (e)
{
if (e.button == Sys.UI.MouseButton.leftButton)
{
if (!this._dragOVBox)
{
this._dragOVBox = true;this._ovPanStartLeft = this._boxDivObject.offsetLeft;this._ovPanStartTop = this._boxDivObject.offsetTop;this._mouseDownOriginX = this._mousePanX = e.clientX;this._mouseDownOriginY = this._mousePanY = e.clientY;$addHandler(this.get_element(), 'mouseup', this._panMouseUpHandler);$addHandler(this.get_element(), 'mousemove', this._panMouseMoveHandler);e.preventDefault();e.stopPropagation();}
}
},
_doPanMouseMove : function (e)
{
if (this._dragOVBox)
{
var ex = this._ovPanStartLeft + (e.clientX - this._mouseDownOriginX);var ey = this._ovPanStartTop + (e.clientY - this._mouseDownOriginY);this._boxDivObject.style.left = ex + "px";this._boxDivObject.style.top = ey + "px";if (this._aoiResizable)
{
this._boxResizeObject.style.left = (ex + this._boxWidth - 5) + "px";this._boxResizeObject.style.top = (ey + this._boxHeight - 5) + "px";}
var nx = Math.round((e.clientX - this._mousePanX) * this._mapXRatio);var ny = Math.round((e.clientY - this._mousePanY) * this._mapYRatio);if (nx !== 0 || ny !== 0)
{
this._map._doContinuousPan (nx, ny);}
this._mousePanX = e.clientX;this._mousePanY = e.clientY;e.preventDefault();e.stopPropagation();}
},
_doPanMouseUp : function (e)
{
this._dragOVBox = false;$removeHandler(this.get_element(), 'mouseup', this._panMouseUpHandler);$removeHandler(this.get_element(), 'mousemove', this._panMouseMoveHandler);this._map._doContinuousPan (0, 0);},
_doResizeMouseDown : function (e)
{
if (e.button == Sys.UI.MouseButton.leftButton)
{
if (!this._dragOVResizeBox)
{
this._dragOVResizeBox = true;var bounds;bounds = Sys.UI.DomElement.getBounds (this.get_element());this._resizeOriginX = bounds.x + (bounds.width / 2);this._resizeOriginY = bounds.y + (bounds.height / 2);bounds = Sys.UI.DomElement.getBounds (this._boxDivObject);this._resizeWidth = bounds.width - (this._lineWidth * 2);this._resizeHeight = bounds.height - (this._lineWidth * 2);$addHandler(this.get_element(), 'mouseup', this._resizeMouseUpHandler);$addHandler(this.get_element(), 'mousemove', this._resizeMouseMoveHandler);e.preventDefault();e.stopPropagation();}
}
},
_doResizeMouseMove : function (e)
{
if (this._dragOVResizeBox)
{
var normalWidth = 0;var normalHeight = 0;var deltaX = Math.abs(e.clientX - this._resizeOriginX);var deltaY = Math.abs(e.clientY - this._resizeOriginY);if (deltaX > (deltaY * this._mapXYRatio))
{
normalWidth = deltaX * 2;if (normalWidth < this._aoiMinWidth)
{
normalWidth = this._aoiMinWidth;}
else if (normalWidth > this._maxBoxWidth)
{
normalWidth = this._maxBoxWidth;}
normalHeight = normalWidth / this._mapXYRatio;}
else
{
normalHeight = deltaY * 2;if (normalHeight < this._aoiMinHeight)
{
normalHeight = this._aoiMinHeight;}
else if (normalHeight > this._maxBoxHeight)
{
normalHeight = this._maxBoxHeight;}
normalWidth = normalHeight * this._mapXYRatio;}
this._boxDivObject.style.width = (normalWidth - (this._lineWidth * 2)) + "px";this._boxDivObject.style.height = (normalHeight - (this._lineWidth * 2)) + "px";this._boxDivObject.style.left = ((this._width - normalWidth) / 2) + "px";this._boxDivObject.style.top = ((this._height - normalHeight) / 2) + "px";this._boxWidth = normalWidth;this._boxHeight = normalHeight;e.preventDefault();e.stopPropagation();}
},
_doResizeMouseUp : function (e)
{
this._dragOVResizeBox = false;$removeHandler(this.get_element(), 'mouseup', this._resizeMouseUpHandler);$removeHandler(this.get_element(), 'mousemove', this._resizeMouseMoveHandler);if (!this._map.zoom(this._resizeWidth / this._boxWidth))
{
this._boxDivObject.style.width = this._resizeWidth + "px";this._boxDivObject.style.height = this._resizeHeight + "px";this._boxDivObject.style.left = ((this._width - this._resizeWidth) / 2) + "px";this._boxDivObject.style.top = ((this._height - this._resizeHeight) / 2) + "px";}
},
_updateAOI : function (boxLeft, boxTop, boxWidth, boxHeight)
{
this._boxLeft = boxLeft;this._boxTop = boxTop;this._boxWidth = boxWidth;this._boxHeight = boxHeight;this._boxRight = boxLeft + boxWidth;this._boxBottom = boxTop + boxHeight;if(!this.get_isInitialized()) { return;} 
this._boxDivObject.style.left = boxLeft + "px";this._boxDivObject.style.top = boxTop + "px";this._boxDivObject.style.width = boxWidth + "px";this._boxDivObject.style.height = boxHeight + "px";if (this._aoiResizable)
{
this._boxResizeObject.style.left = (boxLeft + boxWidth - 5) + "px";this._boxResizeObject.style.top = (boxTop + boxHeight - 5) + "px";}
this._updateMapRatio();},
processCallbackResult : function(action, params)
{
if (action=='aoiextent')
{
this._updateAOI (params[0], params[1], params[2], params[3]);if (params[4])
{
if(!this._imageObject.src.endsWith(params[4])) {
this._imageObject.src = params[4];}
}
}
},
show : function()
{
var ovm = this.get_element();if (ovm)
{
ovm.style.visibility = 'visible';}
},
hide : function()
{
var ovm = this.get_element();if (ovm)
{
ovm.style.visibility = 'hidden';}
},
isVisible : function()
{
var ovm = this.get_element();return ovm && ovm.style.visibility != 'hidden';},
get_map : function ()
{
return this._map;},
set_map : function(value)
{
if (this._map != value) {
this._map = value;this.raisePropertyChanged('map');}
},
get_width : function ()
{
return this._width;},
set_width : function(value)
{
if (this._width != value) {
this._width = value;this.raisePropertyChanged('width');}
},
get_height : function ()
{
return this._height;},
set_height : function(value)
{
if (this._height != value) {
this._height = value;this.raisePropertyChanged('height');}
},
get_boxLeft : function ()
{
return this._boxLeft;},
set_boxLeft : function(value)
{
if (this._boxLeft != value) {
this._boxLeft = value;this.raisePropertyChanged('boxLeft');}
},
get_boxTop : function ()
{
return this._boxTop;},
set_boxTop : function(value)
{
if (this._boxTop != value) {
this._boxTop = value;this.raisePropertyChanged('boxTop');}
},
get_boxWidth : function ()
{
return this._boxWidth;},
set_boxWidth : function(value)
{
if (this._boxWidth != value) {
this._boxWidth = value;this.raisePropertyChanged('boxWidth');}
},
get_boxHeight : function ()
{
return this._boxHeight;},
set_boxHeight : function(value)
{
if (this._boxHeight != value) {
this._boxHeight = value;this.raisePropertyChanged('boxHeight');}
},
get_imageURL : function ()
{
return this._imageURL;},
set_imageURL : function(value)
{
if (this._imageURL != value) {
this._imageURL = value;this.raisePropertyChanged('imageURL');}
},
get_blankURL : function ()
{
return this._blankURL;},
set_blankURL : function(value)
{
if (this._blankURL != value) {
this._blankURL = value;this.raisePropertyChanged('blankURL');}
},
get_tooltip : function ()
{
return this._tooltip;},
set_tooltip : function(value)
{
if (this._tooltip != value) {
this._tooltip = value;this.raisePropertyChanged('tooltip');}
},
get_boxColor : function ()
{
return this._boxColor;},
set_boxColor : function(value)
{
if (this._boxColor != value) {
this._boxColor = value;this.raisePropertyChanged('boxColor');}
},
get_lineWidth : function ()
{
return this._lineWidth;},
set_lineWidth : function(value)
{
if (this._lineWidth != value) {
this._lineWidth = value;this.raisePropertyChanged('lineWidth');}
},
get_lineType : function ()
{
return this._lineType;},
set_lineType : function(value)
{
if (this._lineType != value) {
this._lineType = value;this.raisePropertyChanged('lineType');}
},
get_aoiResizable : function ()
{
return this._aoiResizable;},
set_aoiResizable : function(value)
{
if (this._aoiResizable != value) {
this._aoiResizable = value;this.raisePropertyChanged('aoiResizable');}
},
get_aoiDraggable : function ()
{
return this._aoiDraggable;},
set_aoiDraggable : function(value)
{
if (this._aoiDraggable != value) {
this._aoiDraggable = value;this.raisePropertyChanged('aoiDraggable');}
},
get_aoiMinWidth : function ()
{
return this._aoiMinWidth;},
set_aoiMinWidth : function(value)
{
if (this._aoiMinWidth != value) {
this._aoiMinWidth = value;this.raisePropertyChanged('aoiMinWidth');}
},
get_aoiMinHeight : function ()
{
return this._aoiMinHeight;},
set_aoiMinHeight : function(value)
{
if (this._aoiMinHeight != value) {
this._aoiMinHeight = value;this.raisePropertyChanged('aoiMinHeight');}
}
};ESRI.ADF.UI.OverviewMap.registerClass('ESRI.ADF.UI.OverviewMap', Sys.UI.Control);ESRI.ADF.UI._ZoomLevelDragDropManagerInternal = function() {
ESRI.ADF.UI._ZoomLevelDragDropManagerInternal.initializeBase(this);this._instance = null;};ESRI.ADF.UI._ZoomLevelDragDropManagerInternal.prototype = {
_getInstance : function() {
this._instance = new AjaxControlToolkit.GenericDragDropManager();this._instance.initialize();this._instance.add_dragStart(Function.createDelegate(this, this._raiseDragStart));this._instance.add_dragStop(Function.createDelegate(this, this._raiseDragStop));return this._instance;}
};ESRI.ADF.UI._ZoomLevelDragDropManagerInternal.registerClass('ESRI.ADF.UI._ZoomLevelDragDropManagerInternal', AjaxControlToolkit._DragDropManager);ESRI.ADF.UI.ZoomLevelDragDropManagerInternal = new ESRI.ADF.UI._ZoomLevelDragDropManagerInternal();ESRI.ADF.UI.ZoomLevel = function(element) { 
ESRI.ADF.UI.ZoomLevel.initializeBase(this, [element]);this._steps = 0;this._level = -1;this._orientation = 1;this._dynamicZoomInFactor = 2.0;this._dynamicZoomOutFactor = 0.5;this._map = null;this._imgTop = "";this._imgBottom = "";this._imgSelected = "";this._imgDefault = "";this._hasLevels = false;this._topElement = null;this._bottomElement = null;this._railElement = null;this._handle = null;this._handleImage = null;this._isHorizontal = true;this._dragHandle = null;this._mouseupHandler = null;this._selectstartHandler = null;this._selectstartPending = false;this._imgHeight = 0;this._imgWidth = 0;};ESRI.ADF.UI.ZoomLevel.prototype = {
initialize : function()
{
ESRI.ADF.UI.ZoomLevel.callBaseMethod(this, 'initialize');this._hasLevels = (this._map.get_layers().get_levels() !== null);if (this._hasLevels)
{
this._steps = this._map.get_layers().get_levels().length;this._minimum = 0;this._maximum = this._steps - 1;this._mapExtentChangedHandler = Function.createDelegate(this, this._mapExtentChanged);this._map.add_extentChanged(this._mapExtentChangedHandler);}
this._initializeLayout();}, 
dispose : function()
{
if (this._hasLevels)
{
this._disposeHandlers();this._map.remove_extentChanged(this._mapExtentChangedHandler);}
ESRI.ADF.UI.ZoomLevel.callBaseMethod(this, 'dispose');},
_setFloat : function (element, direction)
{
if (Sys.Browser.agent == Sys.Browser.Firefox)
{
element.style.cssFloat = direction;}
else
{
element.style.styleFloat = direction;}
},
_initializeLayout : function()
{
var parentElement = this.get_element();this._isHorizontal = (this._orientation == -1);this._topElement = document.createElement('IMG');this._topElement.src = (this._isHorizontal ? this._imgBottom : this._imgTop);this._topElement.style.cursor = "pointer";if (this._isHorizontal)
{
this._setFloat (this._topElement, "left");}
else
{
this._topElement.style.verticalAlign = "bottom";this._topElement.style.display = "block";}
this._topElement.setAttribute("Alt", "Click to zoom in or out.");parentElement.appendChild(this._topElement);if (this._hasLevels)
{
this._railElement = document.createElement('DIV');this._railElement.innerHTML = '<div></div>';this._handle = this._railElement.childNodes[0];this._handle.style.overflow = 'hidden';this._handle.style.position = 'absolute';this._handle.style.height = this._imgHeight + 'px';this._handle.style.width = this._imgWidth + 'px';this._handle.style.left = '0px';this._handle.style.top = '0px';parentElement.appendChild(this._railElement);this._handleImage = document.createElement('IMG');this._handleImage.style.position = 'absolute';this._handleImage.style.left = '0px';this._handleImage.style.top = '0px';this._handleImage.src = this._imgSelected;this._handleImage.setAttribute("Alt", "Click to zoom in or out.");this._handle.appendChild(this._handleImage);if (this._isHorizontal)
{
this._railElement.style.backgroundRepeat = "repeat-x";this._railElement.style.height = this._imgHeight + "px";this._railElement.style.width = (this._steps * this._imgWidth) + "px";this._setFloat (this._railElement, "left");}
else
{
this._railElement.style.backgroundRepeat = "repeat-y";this._railElement.style.width = this._imgWidth + "px";this._railElement.style.height = (this._steps * this._imgHeight) + "px";}
this._railElement.style.cursor = "pointer";this._railElement.style.position = "relative";this._railElement.style.display = "block";this._railElement.style.backgroundImage = "url('" + this._imgDefault + "')";this._railElement.setAttribute("Alt", "Click to zoom in or out.");this._railElement.style.outline = "none";}
this._bottomElement = document.createElement('IMG');this._bottomElement.src = (this._isHorizontal ? this._imgTop : this._imgBottom);this._bottomElement.style.cursor = "pointer";if (this._isHorizontal)
{
this._setFloat (this._bottomElement, "left");}
else
{
this._bottomElement.style.verticalAlign = "top";}
this._bottomElement.setAttribute("Alt", "Click to zoom in or out.");parentElement.appendChild(this._bottomElement);this._initializeSlider();},
_initializeSlider : function()
{
if (this._hasLevels)
{
this._setCurrentLevel();this._initializeDragHandle();ESRI.ADF.UI.ZoomLevelDragDropManagerInternal.registerDropTarget(this);}
this._initializeHandlers();},
_startDragDrop : function(dragVisual)
{
this._resetDragHandle();ESRI.ADF.UI.ZoomLevelDragDropManagerInternal.startDragDrop(this, dragVisual, null);},
_onMouseDown : function(evt)
{
window._event = evt;evt.preventDefault();if(!ESRI.ADF.UI.ZoomLevel.DropPending) {
ESRI.ADF.UI.ZoomLevel.DropPending = this;$addHandler(document, 'selectstart', this._selectstartHandler);this._selectstartPending = true;this._startDragDrop(this._dragHandle);}
},
_onMouseUp : function(evt)
{
var srcElement = evt.target;if(ESRI.ADF.UI.ZoomLevel.DropPending == this) {
ESRI.ADF.UI.ZoomLevel.DropPending = null;if(this._selectstartPending) {
this._selectstartPending = false;$removeHandler(document, 'selectstart', this._selectstartHandler);}
}
},
_DragDropHandler : function(evt)
{
evt.preventDefault();},
_onSelectStart : function(evt)
{
evt.preventDefault();},
_calcValue : function(mouseOffset)
{
var val;var _minimum = this._minimum;var _maximum = this._maximum;var handleBounds = this._getHandleBounds();var sliderBounds = this._getRailBounds();var handleX = (mouseOffset) ? (mouseOffset - handleBounds.width / 2) : (handleBounds.x - sliderBounds.x);var extent = sliderBounds.width - handleBounds.width;var percent = handleX / extent;val = (handleX === 0) ? _minimum : (handleX == (sliderBounds.width - handleBounds.width)) ? _maximum : _minimum + percent * (_maximum - _minimum);if (this._steps > 0)
{
val = this._getNearestStepValue(val);}
val = (val < this._minimum) ? this._minimum : (val > this._maximum) ? this._maximum : val;this._setLevel(val);return val;},
_getBoundsInternal : function(element)
{
var bounds = $common.getBounds(element);if(!this._isHorizontal) {
bounds = { x : bounds.y, 
y : bounds.x, 
height : bounds.width, 
width : bounds.height, 
right : bounds.right,
bottom : bounds.bottom,
location : {x:bounds.y, y:bounds.x},
size : {width:bounds.height, height:bounds.width}
};}
return bounds;},
_getRailBounds : function()
{
return this._getBoundsInternal(this._railElement);},
_getHandleBounds : function()
{
return this._getBoundsInternal(this._handle);},
_initializeDragHandle : function()
{
this._dragHandle = document.createElement('DIV');var dh = this._dragHandle;dh.style.position = 'absolute';dh.style.width = '1px';dh.style.height = '1px';dh.style.overflow = 'hidden';dh.style.zIndex = '999';dh.style.background = 'none';document.body.appendChild(this._dragHandle);},
_resetDragHandle : function()
{
var handleBounds = $common.getBounds(this._handle);$common.setLocation(this._dragHandle, {x:handleBounds.x, y:handleBounds.y});},
_initializeHandlers : function()
{
$addHandlers(this._topElement,
{
'click': this._onTopClick
},
this);if (this._hasLevels)
{
this._selectstartHandler = Function.createDelegate(this, this._onSelectStart);this._mouseupHandler = Function.createDelegate(this, this._onMouseUp);$addHandler(document, 'mouseup', this._mouseupHandler);$addHandlers(this._handle, 
{
'mousedown': this._onMouseDown,
'dragstart': this._DragDropHandler,
'drag': this._DragDropHandler,
'dragend': this._DragDropHandler
},
this);$addHandlers(this._railElement,
{
'click': this._onRailClicked
},
this);}
$addHandlers(this._bottomElement,
{
'click': this._onBottomClick
},
this);},
_disposeHandlers : function()
{
$clearHandlers(this._topElement);$clearHandlers(this._bottomElement);if (this._hasLevels)
{
$clearHandlers(this._handle);$clearHandlers(this._railElement);$removeHandler(document, 'mouseup', this._mouseupHandler);this._mouseupHandler = null;this._selectstartHandler = null;}
if (this._handleImage)
{
$clearHandlers(this._handleImage);}
},
_setHandleOffset : function(value)
{
var _minimum = this._minimum;var _maximum = this._maximum;var handleBounds = this._getHandleBounds();var sliderBounds = this._getRailBounds();var Commons = AjaxControlToolkit.CommonToolkitScripts;if (handleBounds.width <= 0 && sliderBounds.width <= 0)
{
if(this._isHorizontal) {
handleBounds.width = parseInt(this._handle.style.width, 10);sliderBounds.width = parseInt(this._railElement.style.width, 10);}
else {
handleBounds.width = parseInt(this._handle.style.height, 10);sliderBounds.width = parseInt(this._railElement.style.height, 10);}
}
var extent = _maximum - _minimum;var fraction = (value - _minimum) / extent;var hypOffset = Math.round(fraction * (sliderBounds.width - handleBounds.width));var offset = (value == _minimum) ? 0 : (value == _maximum) ? (sliderBounds.width - handleBounds.width) : hypOffset;if (this._isHorizontal) {
this._handle.style.left = offset + 'px';}
else {
this._handle.style.top = offset + 'px';}
},
_getNearestStepValue : function(value) {
if (this._steps === 0)
{
return value;}
var extent = this._maximum - this._minimum;if (extent === 0)
{
return value;}
var delta = extent / (this._steps - 1);return Math.round(value / delta) * delta;},
_onHandleReleased : function() {
this._zoomMap();},
_onTopClick : function(evt)
{
if (this._hasLevels)
{
this._setLevel(this._getLevel() - 1);this._setHandleOffset(this._getLevel());this._zoomMap();}
else
{
this._map.zoom(this._isHorizontal ? this._dynamicZoomOutFactor : this._dynamicZoomInFactor);}
},
_onBottomClick : function(evt)
{
if (this._hasLevels)
{
this._setLevel(this._getLevel() + 1);this._setHandleOffset(this._getLevel());this._zoomMap();}
else
{
this._map.zoom(this._isHorizontal ? this._dynamicZoomInFactor : this._dynamicZoomOutFactor);}
},
_onRailClicked : function(evt) {
if (evt.target == this._railElement)
{
var handleBounds = this._getHandleBounds();var sliderBounds = this._getRailBounds();var offset = (this._orientation == -1) ? evt.offsetX : evt.offsetY;var minOffset = handleBounds.width / 2;var maxOffset = sliderBounds.width - minOffset;offset = (offset < minOffset) ? minOffset : (offset > maxOffset) ? maxOffset : offset;this._calcValue(offset);this._zoomMap();}
},
_zoomMap : function ()
{
var curLevel = this._map.get_layers().getLevelByNearestPixelsize(this._map._pixelsizeX);var levels = this._map.get_layers().get_levels();var mapLevel;if (this._isHorizontal)
{
mapLevel = this._getLevel();}
else
{
mapLevel = this._maximum - this._getLevel();}
if (curLevel != mapLevel)
{
var factor = this._map._pixelsizeX / levels[mapLevel];this._map.zoom (factor);}
},
_mapExtentChanged : function(sender, evt)
{
this._setCurrentLevel();},
_setCurrentLevel : function ()
{
if (this._hasLevels)
{
var level = this._map.get_layers().getLevelByNearestPixelsize(this._map._pixelsizeX);if (this._isHorizontal)
{
this._setLevel(level);}
else
{
this._setLevel(this._maximum - level);}
this._setHandleOffset(this._getLevel());}
},
_getLevel : function ()
{
return this._level;},
_setLevel : function (value)
{
if (this._level != value)
{
if (value >= this._minimum && value <= this._maximum)
{
this._level = value;}
}
},
get_dragDataType : function() {
return 'HTML';},
getDragData : function() {
return this._handle;},
get_dragMode : function() {
return AjaxControlToolkit.DragMode.Move;},
onDragStart : function() {
this._resetDragHandle();},
onDrag : function() {
var dragHandleBounds = this._getBoundsInternal(this._dragHandle);var handleBounds = this._getHandleBounds();var sliderBounds = this._getRailBounds();var handlePosition;if (this._isHorizontal)
{
handlePosition = { x:dragHandleBounds.x - sliderBounds.x, y:0 };}
else
{
handlePosition = { y:dragHandleBounds.x - sliderBounds.x, x:0 };}
$common.setLocation(this._handle, handlePosition);this._calcValue(null);this._setHandleOffset(this._getLevel());},
onDragEnd : function() {
this._onHandleReleased();},
get_dropTargetElement : function() {
return document.body;},
canDrop : function(dragMode, dataType) {
return dataType == 'HTML';},
drop : Function.emptyMethod,
onDragEnterTarget : Function.emptyMethod,
onDragLeaveTarget : Function.emptyMethod,
onDragInTarget : Function.emptyMethod,
get_map : function ()
{
return this._map;},
set_map : function(value)
{
if (this._map != value)
{
this._map = value;this.raisePropertyChanged('map');}
},
get_imgTop : function ()
{
return this._imgTop;},
set_imgTop : function(value)
{
if (this._imgTop != value)
{
this._imgTop = value;this.raisePropertyChanged('imgTop');}
},
get_imgBottom : function ()
{
return this._imgBottom;},
set_imgBottom : function(value)
{
if (this._imgBottom != value)
{
this._imgBottom = value;this.raisePropertyChanged('imgBottom');}
},
get_imgSelected : function ()
{
return this._imgSelected;},
set_imgSelected : function(value)
{
if (this._imgSelected != value)
{
this._imgSelected = value;this.raisePropertyChanged('imgSelected');}
},
get_imgDefault : function ()
{
return this._imgDefault;},
set_imgDefault : function(value)
{
if (this._imgDefault != value)
{
this._imgDefault = value;this.raisePropertyChanged('imgDefault');}
},
get_imageHeight : function ()
{
return this._imgHeight;},
set_imageHeight : function(value)
{
if (this._imgHeight != value)
{
this._imgHeight = value;this.raisePropertyChanged('imageHeight');}
},
get_imageWidth : function ()
{
return this._imgWidth;},
set_imageWidth : function(value)
{
if (this._imgWidth != value)
{
this._imgWidth = value;this.raisePropertyChanged('imageWidth');}
},
get_orientation : function ()
{
return this._orientation;},
set_orientation : function(value)
{
if (this._orientation != value)
{
this._orientation = value;this.raisePropertyChanged('orientation');}
},
get_dynamicZoomInFactor : function ()
{
return this._dynamicZoomInFactor;},
set_dynamicZoomInFactor : function(value)
{
if (this._dynamicZoomInFactor != value)
{
this._dynamicZoomInFactor = value;this.raisePropertyChanged('dynamicZoomInFactor');}
},
get_dynamicZoomOutFactor : function ()
{
return this._dynamicZoomOutFactor;},
set_dynamicZoomOutFactor : function(value)
{
if (this._dynamicZoomOutFactor != value)
{
this._dynamicZoomOutFactor = value;this.raisePropertyChanged('dynamicZoomOutFactor');}
}
};ESRI.ADF.UI.ZoomLevel.DropPending = null;ESRI.ADF.UI.ZoomLevel.registerClass('ESRI.ADF.UI.ZoomLevel', Sys.UI.Control);ESRI.ADF.UI.Magnifier = function() {
ESRI.ADF.UI.Magnifier.initializeBase(this);this._blankImagePath = null;this._magTableWidth = 200;this._magTableHeight = 200;this._magFactorRowHeight = 18;this._floatingPanel = null;};ESRI.ADF.UI.Magnifier.prototype = {
initialize: function() {
ESRI.ADF.UI.Magnifier.callBaseMethod(this, 'initialize');var fpID = this._floatingPanel.get_element().id;this.set_id(fpID + '_Magnifier');Sys.Application.addComponent(this);this._floatingPanelBodyCell = $get(fpID + '_BodyCell');this._contentDiv = $get(fpID + '_ContentDiv');this._contentTable = $get(fpID + '_Content');this._contentsContainer = $get(fpID + '_Contents');this._factorRow = $get(fpID + '_FactorRow');this._magnifierAOI = $get(fpID + '_AOIBox');this._magnifierCrosshair = $get(fpID + '_Crosshair');this._mapImage = $get(fpID + '_MapImage');this._mapArea = $get(fpID + '_MapArea');this._extentChangingHandler = Function.createDelegate(this, this._mapExtentChanging);this._map.add_extentChanging(this._extentChangingHandler);this._hideMapHandler = Function.createDelegate(this, this._hideMapImage);this._getMapImageHandler = Function.createDelegate(this, this._getMapImage)
this._resizeMagnifierArea = Function.createDelegate(this, this._resizeMagnifierArea);this._setEventHandlers();},
dispose: function() {
this._removeEventHandlers();this._map.remove_extentChanging(this._extentChangingHandler);this._extentChangingHandler = null;ESRI.ADF.UI.Magnifier.callBaseMethod(this, 'dispose');},
_mapExtentChanging: function(map, args) {
this._hideMapImage();},
doCallback: function(argument, context) {
ESRI.ADF.System._doCallback(this._callbackFunctionString, this.get_uniqueID(), this._floatingPanel.get_element().id, argument, context);},
_setAOIBox: function() {
var floatingPanel = this._floatingPanel.get_element();var controlName = floatingPanel.id;var magSelect = $get(controlName + "_MagFactor");var tDisplay = floatingPanel.style.display;var index = magSelect.selectedIndex;var val = parseInt(magSelect.options[index].value, 10);var wDiv = this._contentDiv;var aoi = this._magnifierAOI;var magcross = this._magnifierCrosshair;var winWidth = wDiv.clientWidth;var winHeight = wDiv.clientHeight;if (tDisplay == "none") {
winHeight = this._magTableHeight;winWidth = this._magTableWidth;} else {
this._magTableHeight = winHeight;this._magTableWidth = winWidth;}
var aoiWidth = Math.ceil(winWidth / val);var aoiHeight = Math.ceil(winHeight / val);var magMidX = Math.ceil(winWidth / 2);var magMidY = Math.ceil(winHeight / 2);var crossWidth = parseInt(magcross.style.width, 10);var crossHeight = parseInt(magcross.style.height, 10);aoi.style.width = aoiWidth + "px";aoi.style.height = aoiHeight + "px";aoi.style.left = Math.floor(magMidX - (aoiWidth / 2)) + "px";aoi.style.top = Math.floor(magMidY - (aoiHeight / 2)) + "px";magcross.style.left = (Math.floor(magMidX - (crossWidth / 2)) + 2) + "px";magcross.style.top = (Math.floor(magMidY - (crossHeight / 2)) + 2) + "px";crossHeight = parseInt(this._magnifierCrosshair.style.height, 10) + 2;},
_toggleMagnifierMapImage: function(visibility) {
if (visibility === null) { visibility = "visible";}
if (this._mapImage !== null) {
this._mapImage.style.visibility = visibility;if (visibility === "hidden") { this._mapImage.src = this._blankImagePath;}
}
},
_hideMapImage: function() {
var imgObj = this._mapImage;if (imgObj !== null) {
imgObj.style.visibility = "hidden";imgObj.src = this._blankImagePath;}
if (this._magnifierAOI !== null) {
this._setAOIBox();this._magnifierAOI.style.visibility = "visible";}
if (this._magnifierCrosshair !== null) { this._magnifierCrosshair.style.visibility = "visible";}
},
_showMapImage: function() {
var imgObj = this._mapImage;if (imgObj !== null) { imgObj.style.visibility = "visible";}
if (this._magnifierAOI !== null) {
this._magnifierAOI.style.visibility = "hidden";this._setAOIBox();}
if (this._magnifierCrosshair !== null) { this._magnifierCrosshair.style.visibility = "hidden";}
},
_requestMagnifierMapImage: function() {
var m = this._map;var coords = "";if (m !== null) {
var box = Sys.UI.DomElement.getBounds(this._magnifierAOI);var mbox = Sys.UI.DomElement.getBounds(m.get_element());var wDiv = this._contentDiv;var winWidth = parseInt(wDiv.clientWidth, 10);var winHeight = parseInt(this._mapArea.clientHeight, 10);if (!winWidth || !winHeight) { return;}
if (box !== null) {
var left = box.x - mbox.x;var top = box.y - mbox.y;var right = left + box.width;var bottom = top + box.height;coords = left + "," + top + "," + right + "," + bottom;}
var argument = "ControlType=Magnifier&PageID=" + m.pageID + "&EventArg=NewExtent&width=" + winWidth + "&height=" + winHeight + "&coords=" + coords;this.doCallback(argument, this);}
},
_onMagFactorChange: function() {
this._setAOIBox();this._requestMagnifierMapImage();},
_getMapImage: function() {
this._hideMapImage();this._requestMagnifierMapImage();},
_resizeMagnifierArea: function(sender, args) {
var height = args.height;var width = args.width;height -= (this._factorRow.clientHeight + 2);var crossHeight = parseInt(this._magnifierCrosshair.style.height, 10) + 2;if (height < crossHeight) { height = crossHeight;}
this._contentDiv.parentNode.style.height = height + "px";this._mapArea.style.height = height + "px";this._setAOIBox();},
_setStartSize: function() {
var floatingPanel = this._floatingPanel.get_element();var tDisplay = floatingPanel.style.display;floatingPanel.style.display = '';var tableheight = this._contentTable.clientHeight;var rowheight = this._factorRow.clientHeight;if (tDisplay == "none") {
tableheight = this._magTableHeight;rowheight = this._magFactorRowHeight;} else {
this._magTableHeight = tableheight;this._magFactorRowHeight = rowheight;}
var height = tableheight - rowheight - 2;if (height < 0) { height = 0;}
this._contentDiv.parentNode.style.height = height + "px";this._mapArea.style.height = height + "px";this._setAOIBox();floatingPanel.style.display = tDisplay;},
_setEventHandlers: function() {
this._floatingPanel.add_dragStart(this._hideMapHandler);this._floatingPanel.add_dragEnd(this._getMapImageHandler);this._floatingPanel.add_resizeStart(this._hideMapHandler);this._floatingPanel.add_resizing(this._resizeMagnifierArea);this._floatingPanel.add_resized(this._getMapImageHandler);this._floatingPanel.add_hide(this._hideMapHandler);this._floatingPanel.add_show(this._getMapImageHandler);this._floatingPanel.add_expanded(Function.createDelegate(this, this._setStartSize));this._floatingPanel.add_expanded(this._getMapImageHandler);var magSelect = $get(this._floatingPanel.get_id() + "_MagFactor");$addHandlers(magSelect, { 'change': this._onMagFactorChange }, this);this._setStartSize();},
_removeEventHandlers: function() {
if (!this._floatingPanel) { return;}
this._floatingPanel.remove_dragStart(this._hideMapHandler);this._floatingPanel.remove_dragEnd(this._getMapImageHandler);this._floatingPanel.remove_resizeStart(this._hideMapHandler);this._floatingPanel.remove_resizing(this._resizeMagnifierArea);this._floatingPanel.remove_resized(this._getMapImageHandler);this._floatingPanel.remove_hide(this._hideMapHandler);this._floatingPanel.remove_show(this._getMapImageHandler);this._floatingPanel.remove_expanded(this._getMapImageHandler);var magSelect = $get(this._floatingPanel.get_id() + "_MagFactor");if (magSelect) { $removeHandler(magSelect, 'change', this._onMagFactorChange);}
},
processCallbackResult: function(action, params) {
if (action === 'mapimage') {
this._mapImage.src = params[1];if (params.length > 5) {
var magcoord0 = Math.round(params[2] * 1000) / 1000;var magcoord1 = Math.round(params[3] * 1000) / 1000;var magcoord2 = Math.round(params[4] * 1000) / 1000;var magcoord3 = Math.round(params[5] * 1000) / 1000;var extString = "Extent: " + magcoord0 + ", " + magcoord1 + ", " + magcoord2 + ", " + magcoord3;this._mapImage.alt = extString;this._mapImage.title = extString;}
this._showMapImage();return true;}
},
get_map: function() {
return this._map;},
set_map: function(value) {
if (this._map !== value) {
if (this._extentChangedHandler) { this._map.remove_extentChanged(this._extentChangedHandler);}
this._map = value;if (this._extentChangedHandler) { this._map.add_extentChanged(this._extentChangedHandler);}
}
},
get_uniqueID: function() {
return this._uniqueID;},
set_uniqueID: function(value) { this._uniqueID = value;},
get_callbackFunctionString: function() {
return this._callbackFunctionString;},
set_callbackFunctionString: function(value) {
this._callbackFunctionString = value;},
get_transparency: function() {
return this._transparency;},
set_transparency: function(value) { this._transparency = value;},
get_magnifyFactor: function() {
return this._magnifyFactor;},
set_magnifyFactor: function(value) { this._magnifyFactor = value;},
get_blankImagePath: function() {
return this._blankImagePath;},
set_blankImagePath: function(value) { this._blankImagePath = value;},
get_blankImagePath: function() {
return this._floatingPanel;},
set_floatingPanel: function(value) { this._floatingPanel = value;}
};ESRI.ADF.UI.Magnifier.registerClass('ESRI.ADF.UI.Magnifier', Sys.Component);if (typeof(Sys) !== "undefined") { Sys.Application.notifyScriptLoaded();}

//END ESRI.ArcGIS.ADF.Web.UI.WebControls.Runtime.JavaScript.ESRI.ADF.UI.Navigation.release.js
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();
(function() {var fn = function() {$get('ScriptManager1_HiddenField').value += ';;ESRI.ArcGIS.ADF.Web.UI.WebControls, Version=9.3.1.3000, Culture=neutral, PublicKeyToken=8fc3cc631e44ad86:lt-LT:5b74ae6b-e789-47e1-85a7-8889e4c7ad29:8071b9f9:74aa143e:29d50843:d9392677;AjaxControlToolkit, Version=3.0.30512.23850, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e:lt-LT:e7ecf951-fa1a-4469-8f7e-5ca55e1edb90:9ea3f0e2:e2e86ef9:9e8e87e9;ESRI.ArcGIS.ADF.Web.UI.WebControls, Version=9.3.1.3000, Culture=neutral, PublicKeyToken=8fc3cc631e44ad86:lt-LT:5b74ae6b-e789-47e1-85a7-8889e4c7ad29:25c320d5:d44fda31:6767844d:e7fbf59c:712e3e4e:13b601de:f376b70e;AjaxControlToolkit, Version=3.0.30512.23850, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e:lt-LT:e7ecf951-fa1a-4469-8f7e-5ca55e1edb90:c7c04611;ESRI.ArcGIS.ADF.Web.UI.WebControls, Version=9.3.1.3000, Culture=neutral, PublicKeyToken=8fc3cc631e44ad86:lt-LT:5b74ae6b-e789-47e1-85a7-8889e4c7ad29:5aabb63';Sys.Application.remove_load(fn);};Sys.Application.add_load(fn);})();
