
hq.zoomReminder  = {

	init : function() {
		this.dom = $j('#zoomReminder');

		$j('#contentWrapper').bind('layerChange', toolbox.delegate(this.zoomEnd, this));

		$j('#closeReminder').click(toolbox.delegate(this.close, this));

                GEvent.addListener( hq.map.gMap, 'zoomend', toolbox.delegate( this.zoomEnd,  this ) );

		this.zoomEnd();
	},
	
	zoomEnd : function() {
		var zoom = hq.map.gMap.getZoom();
		var layerZoom = $j('.activeLayer').attr('zoomLevel');

		if(layerZoom && zoom < layerZoom)
			this.show();
		else
			this.close();
	},

	show : function() {
      		this.dom.animate({ 
        		height: "20px"
	
		      }, 2000);
	},
	close : function() {
		this.dom.animate({
                        height: "hide"
                 }, 2000);
	}
	
};


$j(document).ready(toolbox.delegate(hq.zoomReminder.init, hq.zoomReminder));


