﻿/*-----------------------------------------------------------------------------------*/
/*Copyright (C) Simplovation LLC (http://Simplovation.com) 2008. All rights reserved.*/
/*-----------------------------------------------------------------------------------*/
/*MiniMapExtender.js*/
Type.registerNamespace("Simplovation.Web.Maps.VE.Extenders");
Simplovation.Web.Maps.VE.Extenders.MiniMapHorizontalAlignment=function(){};Simplovation.Web.Maps.VE.Extenders.MiniMapHorizontalAlignment.prototype={Left:0,Center:1,Right:2};Simplovation.Web.Maps.VE.Extenders.MiniMapHorizontalAlignment.registerEnum("Simplovation.Web.Maps.VE.Extenders.MiniMapHorizontalAlignment",false);
Simplovation.Web.Maps.VE.Extenders.MiniMapVerticalAlignment=function(){};Simplovation.Web.Maps.VE.Extenders.MiniMapVerticalAlignment.prototype={Top:0,Middle:1,Bottom:2};Simplovation.Web.Maps.VE.Extenders.MiniMapVerticalAlignment.registerEnum("Simplovation.Web.Maps.VE.Extenders.MiniMapVerticalAlignment",false);
Simplovation.Web.Maps.VE.Extenders.MiniMapExtender=function(element){Simplovation.Web.Maps.VE.Extenders.MiniMapExtender.initializeBase(this,[element]);this.map=null;this._MiniMapSize=1;this._ShowMiniMap=true;this._VerticalSide=0;this._HorizontalSide=2;this._VerticalOffset=0;this._HorizontalOffset=0;this._miniResizerOnClickHandler=null;};
Simplovation.Web.Maps.VE.Extenders.MiniMapExtender.prototype={initialize:function(){Simplovation.Web.Maps.VE.Extenders.MiniMapExtender.callBaseMethod(this,"initialize");this.map=$find(this.get_element().id);this.realignMiniMap();},realignMiniMap:function(){var veMiniMapSize=(this._MiniMapSize==1?VEMiniMapSize.Small:VEMiniMapSize.Large);if(this.map!=null){if(!this._ShowMiniMap){this.map.HideMiniMap();}else{this.map.ShowMiniMap(0,0,veMiniMapSize);var minimap=$get("MSVE_minimap",this.get_element());var xoffset=0;var yoffset=0;if (this._VerticalSide==0){/*Top*/yoffset=0;yoffset+=this._VerticalOffset;}else if (this._VerticalSide==1){/*Middle*/yoffset=(this.get_element().offsetHeight/2)-(minimap.offsetHeight/2);}else{/*Bottom*/yoffset=this.get_element().offsetHeight-minimap.offsetHeight;yoffset-=this._VerticalOffset;}if (this._HorizontalSide==0){/*Left*/xoffset=0;xoffset+=this._HorizontalOffset;}else if (this._HorizontalSide==1){/*Center*/xoffset=(this.get_element().offsetWidth/2)-(minimap.offsetHeight/2);}else{/*Right*/xoffset=this.get_element().offsetWidth-minimap.offsetWidth;xoffset-=this._HorizontalOffset;}this.map.ShowMiniMap(xoffset,yoffset,veMiniMapSize);var miniMapResizer=$get("MSVE_minimap_resize",this.get_element());if(miniMapResizer!=null){if (this._miniResizerOnClickHandler==null){this._miniResizerOnClickHandler=Function.createDelegate(this,this.miniResizerOnClick);$addHandler(miniMapResizer,"click",this._miniResizerOnClickHandler);}}}}},dispose:function(){Simplovation.Web.Maps.VE.Extenders.MiniMapExtender.callBaseMethod(this,"dispose");},miniResizerOnClick:function(){window.setTimeout("$find('"+this.get_id()+"').SetMiniMapSize("+(this._MiniMapSize==1?"2":"1")+");",100);},get_ShowMiniMap:function(){return this._ShowMiniMap;},set_ShowMiniMap:function(v){this._ShowMiniMap=v;this.realignMiniMap();this.raisePropertyChanged("ShowMiniMap");},get_MiniMapSize:function(){return this._MiniMapSize;},set_MiniMapSize:function(v){if(v==VEMiniMapSize.Small){v=1;}else if(v==VEMiniMapSize.Large){v=2;}this._MiniMapSize=v;this.realignMiniMap();this.raisePropertyChanged("MiniMapSize");},get_VerticalSide:function(){return this._VerticalSide;},set_VerticalSide:function(v){this._VerticalSide=v;this.raisePropertyChanged("VerticalSide");},get_HorizontalSide:function(){return this._HorizontalSide;},set_HorizontalSide:function(v){this._HorizontalSide=v;this.raisePropertyChanged("HorizontalSide");},get_HorizontalOffset:function(){return this._HorizontalOffset;},set_HorizontalOffset:function(v){this._HorizontalOffset=v;this.realignMiniMap();this.raisePropertyChanged("HorizontalOffset");},get_VerticalOffset:function(){return this._VerticalOffset;},set_VerticalOffset:function(v){this._VerticalOffset=v;this.realignMiniMap();this.raisePropertyChanged("VerticalOffset");},ShowMiniMap:function(){this.set_ShowMiniMap(true);},HideMiniMap:function(){this.set_ShowMiniMap(false);},SetMiniMapSize:function(v){this.set_MiniMapSize(v);},SetHorizontalSide:function(v){this.set_HorizontalSide(v);this.realignMiniMap();},SetVerticalSide:function(v){this.set_VerticalSide(v);this.realignMiniMap();}};
Simplovation.Web.Maps.VE.Extenders.MiniMapExtender.registerClass("Simplovation.Web.Maps.VE.Extenders.MiniMapExtender",Sys.UI.Behavior);
Sys.Application.notifyScriptLoaded();
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();