
/* Merged Plone Javascript file
 * This file is dynamically assembled from separate parts.
 * Some of these parts have 3rd party licenses or copyright information attached
 * Such information is valid for that section,
 * not for the entire composite file
 * originating files are separated by - filename.js -
 */

/* - jquery.easyAccordion.js - */
/*
 * 	easyAccordion 0.1 - jQuery plugin
 *	written by Andrea Cima Serniotti	
 *	http://www.madeincima.eu
 *
 *	Copyright (c) 2010 Andrea Cima Serniotti (http://www.madeincima.eu)
 *	Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
 *	Built for jQuery library http://jquery.com
 */
 
(function(jQuery) {
	jQuery.fn.easyAccordion = function(options) {
	
	var defaults = {			
		slideNum: true,
		autoStart: false,
		slideInterval: 3000
	};
			
	this.each(function() {
		
		var settings = jQuery.extend(defaults, options);		
		jQuery(this).find('dl').addClass('easy-accordion');
		
		
		// -------- Set the variables ------------------------------------------------------------------------------
		
		jQuery.fn.setVariables = function() {
			dlWidth = jQuery(this).width();
			dlHeight = jQuery(this).height();
			dtWidth = jQuery(this).find('dt').outerHeight();
			if (jQuery.browser.msie){ dtWidth = $(this).find('dt').outerWidth();}
			dtHeight = dlHeight - (jQuery(this).find('dt').outerWidth()-jQuery(this).find('dt').width());
			slideTotal = jQuery(this).find('dt').size();
			ddWidth = dlWidth - (dtWidth*slideTotal) - (jQuery(this).find('dd').outerWidth(true)-jQuery(this).find('dd').width());
			ddHeight = dlHeight - (jQuery(this).find('dd').outerHeight(true)-jQuery(this).find('dd').height());
		};
		jQuery(this).setVariables();
	
		
		// -------- Fix some weird cross-browser issues due to the CSS rotation -------------------------------------

		if (jQuery.browser.safari){ var dtTop = (dlHeight-dtWidth)/2; var dtOffset = -dtTop;  /* Safari and Chrome */ }
		if (jQuery.browser.mozilla){ var dtTop = dlHeight - 20; var dtOffset = - 20; /* FF */ }
		if (jQuery.browser.msie){ var dtTop = 0; var dtOffset = 0; /* IE */ }
		
		
		// -------- Getting things ready ------------------------------------------------------------------------------
		
		var f = 1;
		jQuery(this).find('dt').each(function(){
			jQuery(this).css({'width':dtHeight,'top':dtTop,'margin-left':dtOffset});	
			if(settings.slideNum == true){
				jQuery('<span class="slide-number">'+0+f+'</span>').appendTo(this);
				if(jQuery.browser.msie){	
					var slideNumLeft = parseInt(jQuery(this).find('.slide-number').css('left')) - 14;
					jQuery(this).find('.slide-number').css({'left': slideNumLeft})
					if(jQuery.browser.version == 6.0 || jQuery.browser.version == 7.0){
						jQuery(this).find('.slide-number').css({'bottom':'auto'});
					}
					if(jQuery.browser.version == 8.0){
					var slideNumTop = jQuery(this).find('.slide-number').css('bottom');
					var slideNumTopVal = parseInt(slideNumTop) + parseInt(jQuery(this).css('padding-top'))  - 12; 
					jQuery(this).find('.slide-number').css({'bottom': slideNumTopVal}); 
					}
				} else {
					var slideNumTop = jQuery(this).find('.slide-number').css('bottom');
					var slideNumTopVal = parseInt(slideNumTop) + parseInt(jQuery(this).css('padding-top')); 
					jQuery(this).find('.slide-number').css({'bottom': slideNumTopVal}); 
				}
			}
			f = f + 1;
		});
		
		if(jQuery(this).find('.active').size()) { 
			jQuery(this).find('.active').next('dd').addClass('active');
		} else {
			jQuery(this).find('dt:first').addClass('active').next('dd').addClass('active');
		}
		
		jQuery(this).find('dt:first').css({'left':'0'}).next().css({'left':dtWidth});
		jQuery(this).find('dd').css({'width':ddWidth,'height':ddHeight});	

		
		// -------- Functions ------------------------------------------------------------------------------
		
		jQuery.fn.findActiveSlide = function() {
				var i = 1;
				this.find('dt').each(function(){
				if(jQuery(this).hasClass('active')){
					activeID = i; // Active slide
				} else if (jQuery(this).hasClass('no-more-active')){
					noMoreActiveID = i; // No more active slide
				}
				i = i + 1;
			});
		};
			
		jQuery.fn.calculateSlidePos = function() {
			var u = 2;
			jQuery(this).find('dt').not(':first').each(function(){	
				var activeDtPos = dtWidth*activeID;
				if(u <= activeID){
					var leftDtPos = dtWidth*(u-1);
					jQuery(this).animate({'left': leftDtPos});
					if(u < activeID){ // If the item sits to the left of the active element
						jQuery(this).next().css({'left':leftDtPos+dtWidth});	
					} else{ // If the item is the active one
						jQuery(this).next().animate({'left':activeDtPos});
					}
				} else {
					var rightDtPos = dlWidth-(dtWidth*(slideTotal-u+1));
					jQuery(this).animate({'left': rightDtPos});
					var rightDdPos = rightDtPos+dtWidth;
					jQuery(this).next().animate({'left':rightDdPos});	
				}
				u = u+ 1;
			});
			setTimeout( function() {
				jQuery('.easy-accordion').find('dd').not('.active').each(function(){ 
					jQuery(this).css({'display':'none'});
				});
			}, 400);
			
		};
	
		jQuery.fn.activateSlide = function() {
			this.parent('dl').setVariables();	
			this.parent('dl').find('dd').css({'display':'block'});
			this.parent('dl').find('dd.plus').removeClass('plus');
			this.parent('dl').find('.no-more-active').removeClass('no-more-active');
			this.parent('dl').find('.active').removeClass('active').addClass('no-more-active');
			this.addClass('active').next().addClass('active');	
			this.parent('dl').findActiveSlide();
			if(activeID < noMoreActiveID){
				this.parent('dl').find('dd.no-more-active').addClass('plus');
			}
			this.parent('dl').calculateSlidePos();	
		};
	
		jQuery.fn.rotateSlides = function(slideInterval, timerInstance) {
			var accordianInstance = jQuery(this);
			timerInstance.value = setTimeout(function(){accordianInstance.rotateSlides(slideInterval, timerInstance);}, slideInterval);
			jQuery(this).findActiveSlide();
			var totalSlides = jQuery(this).find('dt').size();
			var activeSlide = activeID;
			var newSlide = activeSlide + 1;
			if (newSlide > totalSlides) newSlide = 1;
			jQuery(this).find('dt:eq(' + (newSlide-1) + ')').activateSlide(); // activate the new slide
		}


		// -------- Let's do it! ------------------------------------------------------------------------------
		
		function trackerObject() {this.value = null}
		var timerInstance = new trackerObject();
		
		jQuery(this).findActiveSlide();
		jQuery(this).calculateSlidePos();
		
		if (settings.autoStart == true){
			var accordianInstance = jQuery(this);
			var interval = parseInt(settings.slideInterval);
			timerInstance.value = setTimeout(function(){
				accordianInstance.rotateSlides(interval, timerInstance);
				}, interval);
		} 

		jQuery(this).find('dt').not('active').click(function(){		
			jQuery(this).activateSlide();
			clearTimeout(timerInstance.value);
		});	
				
		if (!(jQuery.browser.msie && jQuery.browser.version == 6.0)){ 
			jQuery('dt').hover(function(){
				jQuery(this).addClass('hover');
			}, function(){
				jQuery(this).removeClass('hover');
			});
		}
	});
	};
})(jQuery);

/* - jquery.jmapping.min.js - */
/*
 * jMapping v2.0.0 - jQuery plugin for creating Google Maps
 *
 * Copyright (c) 2009-2010 Brian Landau (Viget Labs)
 * MIT License: http://www.opensource.org/licenses/mit-license.php
 *
 */
(function($){$.jMapping=function(map_elm,options){var settings,gmarkers,mapped,map,markerManager,places,bounds,jMapper,info_windows;map_elm=(typeof map_elm=="string")?$(map_elm).get(0):map_elm;if(!($(map_elm).data('jMapping'))){settings=$.extend(true,{},$.jMapping.defaults);$.extend(true,settings,options);gmarkers={};info_windows=[];var init=function(doUpdate){var info_window_selector,min_zoom,zoom_level;info_window_selector=[settings.side_bar_selector,settings.location_selector,settings.info_window_selector].join(' ');$(info_window_selector).hide();places=getPlaces();bounds=getBounds(doUpdate);if(doUpdate){gmarkers={};info_windows=[];markerManager.clearMarkers();google.maps.event.trigger(map,'resize');map.fitBounds(bounds);if(settings.force_zoom_level){map.setZoom(settings.force_zoom_level);}}else{map=createMap();markerManager=new MarkerManager(map);}
places.each(function(){var marker=createMarker(this);if(!(settings.link_selector===false)){setupLink(this);}
$(document).trigger('markerCreated.jMapping',[marker]);});if(doUpdate){updateMarkerManager();}else{google.maps.event.addListener(markerManager,'loaded',function(){updateMarkerManager();});}
if(!(settings.link_selector===false)&&!doUpdate){attachMapsEventToLinks();}};var createMap=function(){if(settings.map_config){map=new google.maps.Map(map_elm,settings.map_config);}else{map=new google.maps.Map(map_elm,{navigationControlOptions:{style:google.maps.NavigationControlStyle.SMALL},mapTypeControl:false,mapTypeId:google.maps.MapTypeId.ROADMAP,zoom:settings.default_zoom_level});}
map.fitBounds(bounds);if(settings.force_zoom_level){map.setZoom(settings.force_zoom_level);}
return map;};var getPlaces=function(){return $(settings.side_bar_selector+' '+settings.location_selector);};var getPlacesData=function(doUpdate){return places.map(function(){if(doUpdate){$(this).data('metadata',false);}
return $(this).metadata(settings.metadata_options);});};var getBounds=function(doUpdate){var places_data=getPlacesData(doUpdate),newBounds,initialPoint;if(places_data.length){initialPoint=$.jMapping.makeGLatLng(places_data[0].point);}else{initialPoint=$.jMapping.makeGLatLng(settings.default_point);}
newBounds=new google.maps.LatLngBounds(initialPoint,initialPoint);for(var i=1,len=places_data.length;i<len;i++){newBounds.extend($.jMapping.makeGLatLng(places_data[i].point));}
return newBounds;};var setupLink=function(place_elm){var $place_elm=$(place_elm),location_data=$place_elm.metadata(settings.metadata_options),link=$place_elm.find(settings.link_selector);link.attr('href',("#"+location_data.id));};var chooseIconOptions=function(category){if(settings.category_icon_options){if($.isFunction(settings.category_icon_options)){return settings.category_icon_options(category);}else{return settings.category_icon_options[category]||settings.category_icon_options['default'];}}else{return{};}};var createMarker=function(place_elm){var $place_elm=$(place_elm),place_data,point,marker,$info_window_elm,info_window;place_data=$place_elm.metadata(settings.metadata_options);point=$.jMapping.makeGLatLng(place_data.point);if(settings.category_icon_options){icon_options=chooseIconOptions(place_data.category);if(typeof icon_options==="string"){marker=new google.maps.Marker({icon:icon_options,position:point,map:map});}else if(icon_options instanceof google.maps.MarkerImage){marker=new google.maps.Marker({icon:icon_options,position:point,map:map});}else{marker=new StyledMarker({styleIcon:new StyledIcon(StyledIconTypes.MARKER,icon_options),position:point,map:map});}}else{marker=new google.maps.Marker({position:point,map:map});}
$info_window_elm=$place_elm.find(settings.info_window_selector);if($info_window_elm.length>0){info_window=new google.maps.InfoWindow({content:$info_window_elm.html(),maxWidth:settings.info_window_max_width});info_windows.push(info_window);google.maps.event.addListener(marker,'click',function(){$.each(info_windows,function(index,iwindow){if(info_window!=iwindow){iwindow.close();}});info_window.open(map,marker);});}
gmarkers[parseInt(place_data.id,10)]=marker;return marker;};var updateMarkerManager=function(){zoom_level=map.getZoom();min_zoom=(zoom_level<7)?0:(zoom_level-7);markerManager.addMarkers(gmarkersArray(),min_zoom);markerManager.refresh();};var attachMapsEventToLinks=function(){var location_link_selector=[settings.side_bar_selector,settings.location_selector,settings.link_selector].join(' ');$(location_link_selector).live('click',function(e){e.preventDefault();var marker_index=parseInt($(this).attr('href').split('#')[1],10);google.maps.event.trigger(gmarkers[marker_index],"click");});};var gmarkersArray=function(){var marker_arr=[];$.each(gmarkers,function(key,value){marker_arr.push(value);});return marker_arr;};if($(document).trigger('beforeMapping.jMapping',[settings])!=false){init();mapped=true;}else{mapped=false;}
jMapper={gmarkers:gmarkers,settings:settings,mapped:mapped,map:map,markerManager:markerManager,gmarkersArray:gmarkersArray,getBounds:getBounds,getPlacesData:getPlacesData,getPlaces:getPlaces,update:function(){if($(document).trigger('beforeUpdate.jMapping',[this])!=false){init(true);this.map=map;this.gmarkers=gmarkers;this.markerManager=markerManager;$(document).trigger('afterUpdate.jMapping',[this]);}}};$(document).trigger('afterMapping.jMapping',[jMapper]);return jMapper;}else{return $(map_elm).data('jMapping');}};$.extend($.jMapping,{defaults:{side_bar_selector:'#map-side-bar:first',location_selector:'.map-location',link_selector:'a.map-link',info_window_selector:'.info-box',info_window_max_width:425,default_point:{lat:0.0,lng:0.0},metadata_options:{type:'attr',name:'data-jmapping'},default_zoom_level:9},makeGLatLng:function(place_point){return new google.maps.LatLng(place_point.lat,place_point.lng);}});$.fn.jMapping=function(options){if((options=='update')&&$(this[0]).data('jMapping')){$(this[0]).data('jMapping').update();}else{if(options=='update')options={};$(this[0]).data('jMapping',$.jMapping(this[0],options));}
return this;};})(jQuery);

/* - jquery.metadata.js - */
/*
 * Metadata - jQuery plugin for parsing metadata from elements
 *
 * Copyright (c) 2006 John Resig, Yehuda Katz, J�örn Zaefferer, Paul McLanahan
 *
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 *
 * Revision: $Id: jquery.metadata.js 3640 2007-10-11 18:34:38Z pmclanahan $
 *
 */

/**
 * Sets the type of metadata to use. Metadata is encoded in JSON, and each property
 * in the JSON will become a property of the element itself.
 *
 * There are four supported types of metadata storage:
 *
 *   attr:  Inside an attribute. The name parameter indicates *which* attribute.
 *          
 *   class: Inside the class attribute, wrapped in curly braces: { }
 *   
 *   elem:  Inside a child element (e.g. a script tag). The
 *          name parameter indicates *which* element.
 *   html5: Values are stored in data-* attributes.
 *          
 * The metadata for an element is loaded the first time the element is accessed via jQuery.
 *
 * As a result, you can define the metadata type, use $(expr) to load the metadata into the elements
 * matched by expr, then redefine the metadata type and run another $(expr) for other elements.
 * 
 * @name $.metadata.setType
 *
 * @example <p id="one" class="some_class {item_id: 1, item_label: 'Label'}">This is a p</p>
 * @before $.metadata.setType("class")
 * @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
 * @desc Reads metadata from the class attribute
 * 
 * @example <p id="one" class="some_class" data="{item_id: 1, item_label: 'Label'}">This is a p</p>
 * @before $.metadata.setType("attr", "data")
 * @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
 * @desc Reads metadata from a "data" attribute
 * 
 * @example <p id="one" class="some_class"><script>{item_id: 1, item_label: 'Label'}</script>This is a p</p>
 * @before $.metadata.setType("elem", "script")
 * @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
 * @desc Reads metadata from a nested script element
 * 
 * @example <p id="one" class="some_class" data-item_id="1" data-item_label="Label">This is a p</p>
 * @before $.metadata.setType("html5")
 * @after $("#one").metadata().item_id == 1; $("#one").metadata().item_label == "Label"
 * @desc Reads metadata from a series of data-* attributes
 *
 * @param String type The encoding type
 * @param String name The name of the attribute to be used to get metadata (optional)
 * @cat Plugins/Metadata
 * @descr Sets the type of encoding to be used when loading metadata for the first time
 * @type undefined
 * @see metadata()
 */

(function($) {

$.extend({
  metadata : {
    defaults : {
      type: 'class',
      name: 'metadata',
      cre: /({.*})/,
      single: 'metadata'
    },
    setType: function( type, name ){
      this.defaults.type = type;
      this.defaults.name = name;
    },
    get: function( elem, opts ){
      var settings = $.extend({},this.defaults,opts);
      // check for empty string in single property
      if ( !settings.single.length ) settings.single = 'metadata';
      
      var data = $.data(elem, settings.single);
      // returned cached data if it already exists
      if ( data ) return data;
      
      data = "{}";
      
      var getData = function(data) {
        if(typeof data != "string") return data;
        
        if( data.indexOf('{') < 0 ) {
          data = eval("(" + data + ")");
        }
      }
      
      var getObject = function(data) {
        if(typeof data != "string") return data;
        
        data = eval("(" + data + ")");
        return data;
      }
      
      if ( settings.type == "html5" ) {
        var object = {};
        $( elem.attributes ).each(function() {
          var name = this.nodeName;
          if(name.match(/^data-/)) name = name.replace(/^data-/, '');
          else return true;
          object[name] = getObject(this.nodeValue);
        });
      } else {
        if ( settings.type == "class" ) {
          var m = settings.cre.exec( elem.className );
          if ( m )
            data = m[1];
        } else if ( settings.type == "elem" ) {
          if( !elem.getElementsByTagName ) return;
          var e = elem.getElementsByTagName(settings.name);
          if ( e.length )
            data = $.trim(e[0].innerHTML);
        } else if ( elem.getAttribute != undefined ) {
          var attr = elem.getAttribute( settings.name );
          if ( attr )
            data = attr;
        }
        object = getObject(data.indexOf("{") < 0 ? "{" + data + "}" : data);
      }
      
      $.data( elem, settings.single, object );
      return object;
    }
  }
});

/**
 * Returns the metadata object for the first member of the jQuery object.
 *
 * @name metadata
 * @descr Returns element's metadata object
 * @param Object opts An object contianing settings to override the defaults
 * @type jQuery
 * @cat Plugins/Metadata
 */
$.fn.metadata = function( opts ){
  return $.metadata.get( this[0], opts );
};

})(jQuery);

/* - markermanager_packed.js - */
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('9 m(c,b){4 a=3;a.17=c;a.Q=c.1S();a.1f=u K(c);r.p.J.16(a.1f,\'15\',9(){a.2l=3.1I();a.1D(c,b)})}m.l.1D=9(d,b){4 f=3;b=b||{};f.11=m.1u;4 h=d.10;4 i=1;t(4 c 2H h){n(1l d.10.1n(c)===\'2r\'&&1l d.10.1n(c).1h===\'1N\'){4 g=d.10.1n(c).1h;n(g>i){i=g}}}f.F=b.1h||19;f.1E=b.29;f.v=b.1C||A;4 e;n(1l b.1y===\'1N\'){e=b.1y}12{e=m.1w}f.1v=u r.p.E(-e,e);f.1s=u r.p.E(e,-e);f.27=e;f.L={};f.V={};f.V[f.F]={};f.H={};f.H[f.F]=0;r.p.J.16(d,\'1Z\',9(){f.18()});r.p.J.16(d,\'1Y\',9(){f.18()});f.I=9(a){a.1a(2G);f.W--};f.O=9(a){n(f.v){a.1a(f.17);f.W++}};f.1m();f.W=0;f.q=f.1k();r.p.J.1g(f,\'2u\')};m.1u=2q;m.1w=2p;m.1M=2m;m.l.1m=9(){4 a=m.1M;t(4 b=0;b<=3.F;++b){3.V[b]={};3.H[b]=0;3.L[b]=s.2i(a/3.11);a<<=1}};m.l.2h=9(){3.P(3.q,3.I);3.1m()};m.l.w=9(a,c,b){4 d=3.1f.1G(a,c);4 e=u r.p.2e(s.1F((d.x+b.2a)/3.11),s.1F((d.y+b.28)/3.11));o e};m.l.1e=9(i,d,j){4 f=3;4 e=i.1d();i.1B=d;n(3.1E){r.p.J.16(i,\'1A\',9(a,b,c){f.1z(a,b,c)})}4 h=3.w(e,j,u r.p.E(0,0,0,0));t(4 g=j;g>=d;g--){4 k=3.1c(h.x,h.y,g);k.1x(i);h.x=h.x>>1;h.y=h.y>>1}};m.l.N=9(d){4 b=3.q.B<=d.y&&d.y<=3.q.D;4 e=3.q.C;4 c=e<=d.x&&d.x<=3.q.G;n(!c&&e<0){4 a=3.L[3.q.z];c=e+a<=d.x&&d.x<=a-1}o b&&c};m.l.1z=9(f,b,g){4 c=3.F;4 a=U;4 d=3.w(b,c,u r.p.E(0,0,0,0));4 e=3.w(g,c,u r.p.E(0,0,0,0));1t(c>=0&&(d.x!==e.x||d.y!==e.y)){4 h=3.X(d.x,d.y,c);n(h){n(3.1j(h,f)){3.1c(e.x,e.y,c).1x(f)}}n(c===3.Q){n(3.N(d)){n(!3.N(e)){3.I(f);a=A}}12{n(3.N(e)){3.O(f);a=A}}}d.x=d.x>>1;d.y=d.y>>1;e.x=e.x>>1;e.y=e.y>>1;--c}n(a){3.M()}};m.l.26=9(d){4 b=3.F;4 a=U;4 e=d.1d();4 c=3.w(e,b,u r.p.E(0,0,0,0));1t(b>=0){4 f=3.X(c.x,c.y,b);n(f){3.1j(f,d)}n(b===3.Q){n(3.N(c)){3.I(d);a=A}}c.x=c.x>>1;c.y=c.y>>1;--b}n(a){3.M()}3.H[d.1B]--};m.l.25=9(b,a,c){4 d=3.1b(c);t(4 i=b.T-1;i>=0;i--){3.1e(b[i],a,d)}3.H[a]+=b.T};m.l.1b=9(a){o a||3.F};m.l.24=9(a){4 b=0;t(4 z=0;z<=a;z++){b+=3.H[z]}o b};m.l.23=9(c,e,d){4 b=u r.p.22(c,e);4 f=3.w(b,d,u r.p.E(0,0,0,0));4 g=u r.p.21({20:b});4 a=3.X(f.x,f.y,d);n(a!==1r){t(4 i=0;i<a.T;i++){n(c===a[i].1q().1p()&&e===a[i].1q().Z()){g=a[i]}}}o g};m.l.1X=9(d,a,b){4 e=3.1b(b);3.1e(d,a,e);4 c=3.w(d.1d(),3.Q,u r.p.E(0,0,0,0));n(3.N(c)&&a<=3.q.z&&3.q.z<=e){3.O(d);3.M()}3.H[a]++};9 Y(a){3.C=s.R(a[0].x,a[1].x);3.G=s.S(a[0].x,a[1].x);3.B=s.R(a[0].y,a[1].y);3.D=s.S(a[0].y,a[1].y)}Y.l.1o=9(a){n(3.G===a.G&&3.D===a.D&&3.C===a.C&&3.B===a.B){o A}12{o U}};Y.l.1W=9(a){4 b=3;o(b.C<=a.x&&b.G>=a.x&&b.B<=a.y&&b.D>=a.y)};m.l.1c=9(x,y,z){4 b=3.V[z];n(x<0){x+=3.L[z]}4 c=b[x];n(!c){c=b[x]=[];o(c[y]=[])}4 a=c[y];n(!a){o(c[y]=[])}o a};m.l.X=9(x,y,z){4 a=3.V[z];n(x<0){x+=3.L[z]}4 b=a[x];o b?b[y]:1r};m.l.1U=9(j,b,c,e){b=s.R(b,3.F);4 i=j.2F();4 f=j.2E();4 d=3.w(i,b,c);4 g=3.w(f,b,e);4 a=3.L[b];n(f.Z()<i.Z()||g.x<d.x){d.x-=a}n(g.x-d.x+1>=a){d.x=0;g.x=a-1}4 h=u Y([d,g]);h.z=b;o h};m.l.1k=9(){o 3.1U(3.17.2D(),3.Q,3.1v,3.1s)};m.l.18=9(){3.1T(3,3.1J,0)};m.l.1T=9(b,a,c){o 2C.2B(9(){a.2A(b)},c)};m.l.2z=9(){o 3.v?A:U};m.l.2y=9(){o!3.v};m.l.1C=9(){3.v=A;3.13()};m.l.2x=9(){3.v=U;3.13()};m.l.2w=9(){3.v=!3.v;3.13()};m.l.13=9(){n(3.W>0){3.P(3.q,3.I)}n(3.v){3.P(3.q,3.O)}3.M()};m.l.1J=9(){3.Q=3.17.1S();4 a=3.1k();n(a.1o(3.q)&&a.z===3.q.z){o}n(a.z!==3.q.z){3.P(3.q,3.I);n(3.v){3.P(a,3.O)}}12{3.1i(3.q,a,3.1Q);n(3.v){3.1i(a,3.q,3.1P)}}3.q=a;3.M()};m.l.M=9(){r.p.J.1g(3,\'1A\',3.q,3.W)};m.l.P=9(b,a){t(4 x=b.C;x<=b.G;x++){t(4 y=b.B;y<=b.D;y++){3.14(x,y,b.z,a)}}};m.l.14=9(x,y,z,a){4 b=3.X(x,y,z);n(b){t(4 i=b.T-1;i>=0;i--){a(b[i])}}};m.l.1Q=9(x,y,z){3.14(x,y,z,3.I)};m.l.1P=9(x,y,z){3.14(x,y,z,3.O)};m.l.1i=9(c,d,a){4 b=3;b.1O(c,d,9(x,y){a.2o(b,[x,y,c.z])})};m.l.1O=9(j,k,b){4 f=j.C;4 a=j.B;4 d=j.G;4 h=j.D;4 g=k.C;4 c=k.B;4 e=k.G;4 i=k.D;4 x,y;t(x=f;x<=d;x++){t(y=a;y<=h&&y<c;y++){b(x,y)}t(y=s.S(i+1,a);y<=h;y++){b(x,y)}}t(y=s.S(a,c);y<=s.R(h,i);y++){t(x=s.R(d+1,g)-1;x>=f;x--){b(x,y)}t(x=s.S(f,e+1);x<=d;x++){b(x,y)}}};m.l.1j=9(a,c,b){4 d=0;t(4 i=0;i<a.T;++i){n(a[i]===c||(b&&a[i]===c)){a.2n(i--,1);d++}}o d};9 K(b){3.1a(b);4 d=8;4 c=1<<d;4 a=7;3.1L=b;3.2k=-1;3.2j=3.2s=3.2t=3.2g=-1}K.l=u r.p.2v();K.l.1K=9(a){o(1+a/1V)};K.l.1H=9(b){4 a=s.2f(b*s.1R/1V);o(1-0.5/s.1R*s.2d((1+a)/(1-a)))};K.l.1G=9(a,d){4 c=3.1L;4 b=3.1I().2c(a);4 e={x:~~(0.5+3.1K(a.Z())*(2<<(d+6))),y:~~(0.5+3.1H(a.1p())*(2<<(d+6)))};o e};K.l.2b=9(){n(!3.15){3.15=A;r.p.J.1g(3,\'15\')}};',62,168,'|||this|var|||||function||||||||||||prototype|MarkerManager|if|return|maps|shownBounds_|google|Math|for|new|show_|getTilePoint_||||true|minY|minX|maxY|Size|maxZoom_|maxX|numMarkers_|removeOverlay_|event|ProjectionHelperOverlay|gridWidth_|notifyListeners_|isGridPointVisible_|addOverlay_|processAll_|mapZoom_|min|max|length|false|grid_|shownMarkers_|getGridCellNoCreate_|GridBounds|lng|mapTypes|tileSize_|else|refresh|processCellMarkers_|ready|addListener|map_|onMapMoveEnd_||setMap|getOptMaxZoom_|getGridCellCreate_|getPosition|addMarkerBatch_|projectionHelper_|trigger|maxZoom|rectangleDiff_|removeFromArray_|getMapGridBounds_|typeof|resetManager_|get|equals|lat|getLatLng|undefined|nePadding_|while|DEFAULT_TILE_SIZE_|swPadding_|DEFAULT_BORDER_PADDING_|push|borderPadding|onMarkerMoved_|changed|MarkerManager_minZoom|show|initialize|trackMarkers_|floor|LatLngToPixel|LatToY_|getProjection|updateMarkers_|LngToX_|_map|MERCATOR_ZOOM_LEVEL_ZERO_RANGE|number|rectangleDiffCoords_|addCellMarkers_|removeCellMarkers_|PI|getZoom|objectSetTimeout_|getGridBounds_|180|containsPoint|addMarker|zoom_changed|dragend|position|Marker|LatLng|getMarker|getMarkerCount|addMarkers|removeMarker|borderPadding_|height|trackMarkers|width|draw|fromLatLngToDivPixel|log|Point|sin|_Y1|clearMarkers|ceil|_X0|_zoom|projection_|256|splice|apply|100|1024|object|_Y0|_X1|loaded|OverlayView|toggle|hide|isHidden|visible|call|setTimeout|window|getBounds|getNorthEast|getSouthWest|null|in'.split('|'),0,{}))

/* - StyledMarker.js - */
/**
 * @name StyledMarkerMaker
 * @version 0.5
 * @author Gabriel Schneider
 * @copyright (c) 2010 Gabriel Schneider
 * @fileoverview This gives you static functions for creating dynamically
 *     styled markers using Charts API outputs as well as an ability to
 *     extend with custom types.
 */

/**
 * Licensed under the Apache License, Version 2.0 (the 'License');
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an 'AS IS' BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License. 
 */

var StyledIconTypes = {};
var StyledMarker, StyledIcon;
 
(function() {
  var bu_ = 'http://chart.apis.google.com/chart?chst=';
  var gm_ = google.maps;
  var gp_ = gm_.Point;
  var ge_ = gm_.event;
  var gmi_ = gm_.MarkerImage;
  

  /**
  * This class is an extended version of google.maps.Marker. It allows
  * styles to be applied that change it's appearance.
  * @extends google.maps.Marker
  * @param {StyledMarkerOptions} StyledMarkerOptions The options for the Marker
  */
  StyledMarker = function(styledMarkerOptions) {
    var me=this;
    var ci = me.styleIcon = styledMarkerOptions.styleIcon;
    me.bindTo('icon',ci);
    me.bindTo('shadow',ci);
    me.bindTo('shape',ci);
    me.setOptions(styledMarkerOptions);
  };
  StyledMarker.prototype = new gm_.Marker();
  
  /**
  * This class stores style information that can be applied to StyledMarkers.
  * @extends google.maps.MVCObject
  * @param {StyledIconType} styledIconType The type of style this icon is.
  * @param {StyledIconOptions} styledIconOptions The options for this StyledIcon.
  * @param {StyledIcon} styleClass A class to apply extended style information.
  */
  StyledIcon = function(styledIconType,styledIconOptions,styleClass) {
    var k;
    var me=this;
    var i_ = 'icon';
    var sw_ = 'shadow';
    var s_ = 'shape';
    var a_ = [];

    function gs_() {
      var image_ = document.createElement('img');
      var simage_ = document.createElement('img');
      ge_.addDomListenerOnce(simage_, 'load', function() {
        var w = simage_.width, h = simage_.height;
        me.set(sw_,new gmi_(styledIconType.getShadowURL(me),null,null,styledIconType.getShadowAnchor(me,w,h)));
        simage = null;
      });
      ge_.addDomListenerOnce(image_, 'load', function() {
        var w = image_.width, h = image_.height;
        me.set(i_,new gmi_(styledIconType.getURL(me),null,null,styledIconType.getAnchor(me,w,h)));
        me.set(s_,styledIconType.getShape(me,w,h));
        image_ = null;
      });
      image_.src = styledIconType.getURL(me);
      simage_.src = styledIconType.getShadowURL(me);
    }

    /**
    * set:
    * This function sets a given style property to the given value.
    * @param {String} name The name of the property to set.
    * @param {Object} value The value to set the property to.
    * get:
    * This function gets a given style property.
    * @param {String} name The name of the property to get.
    * @return {Object}
    */
    me.as_ = function(v) {
      a_.push(v);
      for(k in styledIconOptions) {
        v.set(k, styledIconOptions[k]);
      }
    }

    if (styledIconType !== StyledIconTypes.CLASS) {
      for (k in styledIconType.defaults) {
        me.set(k, styledIconType.defaults[k]);
      }
      me.setValues(styledIconOptions);
      me.set(i_,styledIconType.getURL(me));
      me.set(sw_,styledIconType.getShadowURL(me));
      if (styleClass) styleClass.as_(me);
      gs_();
      me.changed = function(k) {
        if (k!==i_&&k!==s_&&k!==sw_) {
          gs_();
        }
      };
    } else {
      me.setValues(styledIconOptions);
      me.changed = function(v) {
        styledIconOptions[v] = me.get(v);
        for (k = 0; k < a_.length; k++) {
          a_[k].set(v,me.get(v));
        }
      };
      if (styleClass) styleClass.as_(me);
    }
  };
  StyledIcon.prototype = new gm_.MVCObject();
  
  /**
  * StyledIconType
  * This class holds functions for building the information needed to style markers.
  * getURL:
  * This function builds and returns a URL to use for the Marker icon property.
  * @param {StyledIcon} icon The StyledIcon that holds style information
  * @return {String}
  * getShadowURL:
  * This function builds and returns a URL to use for the Marker shadow property.
  * @param {StyledIcon} icon The StyledIcon that holds style information
  * @return {String{
  * getAnchor:
  * This function builds and returns a Point to indicate where the marker is placed.
  * @param {StyledIcon} icon The StyledIcon that holds style information
  * @param {Number} width The width of the icon image.
  * @param {Number} height The height of the icon image.
  * @return {google.maps.Point}
  * getShadowAnchor:
  * This function builds and returns a Point to indicate where the shadow is placed.
  * @param {StyledIcon} icon The StyledIcon that holds style information
  * @param {Number} width The width of the shadow image.
  * @param {Number} height The height of the shadow image.
  * @return {google.maps.Point}
  * getShape:
  * This function builds and returns a MarkerShape to indicate where the Marker is clickable.
  * @param {StyledIcon} icon The StyledIcon that holds style information
  * @param {Number} width The width of the icon image.
  * @param {Number} height The height of the icon image.
  * @return {google.maps.MarkerShape}
  */
  
  StyledIconTypes.CLASS = {};
  
  StyledIconTypes.MARKER = {
    defaults: {
      text:'',
      color:'00ff00',
      fore:'000000',
      starcolor:null
    },
    getURL: function(props){
      var _url;
      var starcolor_=props.get('starcolor');
      var text_=props.get('text');
      var color_=props.get('color').replace(/#/,'');
      var fore_=props.get('fore').replace(/#/,'');
      if (starcolor_) {
        _url = bu_ + 'd_map_xpin_letter&chld=pin_star|';
      } else {
        _url = bu_ + 'd_map_pin_letter&chld=';
      }
      if (text_) {
        text_ = text_.substr(0,2);
      }
      _url+=text_+'|';
      _url+=color_+'|';
      _url+=fore_;
      if (starcolor_) {
        _url+='|'+starcolor_.replace(/#/,'');
      }
      return _url;
    },
    getShadowURL: function(props){
      if (props.get('starcolor')) {
        return bu_ + 'd_map_xpin_shadow&chld=pin_star';
      } else {
        return bu_ + 'd_map_pin_shadow';
      }
    },
    getAnchor: function(props,width,height){
      return new gp_(width / 2,height);
    },
    getShadowAnchor: function(props,width,height){
      return new gp_(width / 4,height);
    },
    getShape: function(props,width,height){
      var _iconmap = {};
      _iconmap.coord = [
        width / 2, height,
        (7 / 16) * width, (5 / 8) * height,
        (5 / 16) * width, (7 / 16) * height,
        (7 / 32) * width, (5 / 16) * height,
        (5 / 16) * width, (1 / 8) * height,
        (1 / 2) * width, 0,
        (11 / 16) * width, (1 / 8) * height,
        (25 / 32) * width, (5 / 16) * height,
        (11 / 16) * width, (7 / 16) * height,
        (9 / 16) * width, (5 / 8) * height
      ];
      for (var i = 0; i < _iconmap.coord.length; i++) {
        _iconmap.coord[i] = Math.round(_iconmap.coord[i]);
      }
      _iconmap.type = 'poly';
      return _iconmap;
    }
  };
  StyledIconTypes.BUBBLE = {
    defaults: {
      text:'',
      color:'00ff00',
      fore:'000000'
    },
    getURL: function(props){
      var _url = bu_ + 'd_bubble_text_small&chld=bb|';
      _url+=props.get('text')+'|';
      _url+=props.get('color').replace(/#/,'')+'|';
      _url+=props.get('fore').replace(/#/,'');
      return _url;
    },
    getShadowURL: function(props){
      return bu_ + 'd_bubble_text_small_shadow&chld=bb|' + props.get('text');
    },
    getAnchor: function(props,width,height){
      return new google.maps.Point(0,42);
    },
    getShadowAnchor: function(props,width,height){
      return new google.maps.Point(0,44);
    },
    getShape: function(props,width,height){
      var _iconmap = {};
      _iconmap.coord = [
        0,44,
        13,26,
        13,6,
        17,1,
        width - 4,1,
        width,6,
        width,21,
        width - 4,26,
        21,26
      ];
      _iconmap.type = 'poly';
      return _iconmap;
    }
  };
})();

