/**
 * ヒートマップ情報管理クラス
 */
var GJnHeatMapManager = Class.create();
GJnHeatMapManager.prototype = {
    initialize: function(map, options) {
        this.map = map; //Google Maps Object
        this.gridHeatMap = null; //Grid Heatmap Object
        this.minZoom = 13; //Minmum Zoom
        this.setOptions(options);
        this._setHeatMap(this.map, options);
    },
    /**
     * ヒートマップ情報のオプション設定
     */
    setOptions: function(options) {
        this.options = {
        	zoomPrecision : {
        						16 : 6000,
        						15 : 8000,
        						14 : 10000
        					},
        	max : 300,
        	min : 1,
        	autoMax: false,
        	clickZoomInEnabled : false,
        	dspZoomBoxTimeout : 8000,
        	heatmapClick : false,
        	heatmapMouseOver : null,
        	heatmapMouseOut : null,
        	facade: jNextra.Facade.Relaqma.DetailRentHeatmap,
        	opacity : 0.5,
        	outlineColor : '#666',
        	outlineWidth : 0,
        	paneLevel : 2,
        	display : true,
        	heatcolor : ["#AC5EE6", 
        				"#8B70FC", 
      					"#56A1FD", 
      					"#2FD3F0", 
      					"#3DED91", 
      					"#A8EB06", 
      					"#ECE409", 
      					"#FAAA00", 
      					"#FF7D1F", 
      					"#FE5353"],
        	onLoad : true,
        	onDragend : true,
        	onZoomend : true
        };
        Object.extend(this.options, options || {});
    },
    
    /**
     * JNextraヒートマップクラス生成
     */
    _setHeatMap: function(map, opt) {
		this.gridHeatMap = new jNextraGMaps2.GridHeatmap(this.map, this.options, null);
    },
    
    /**
     * ヒートマップ情報の表示
     */
    show : function() {
    	this.gridHeatMap.show();
    	return;
    },
    
    /**
     * ヒートマップ情報の更新
     */
    update : function() {
    	this.gridHeatMap.update();
    	return;
    },

    /**
     * ヒートマップ情報の非表示
     */
    hide : function() {
    	this.gridHeatMap.hide();
    	return;
    },
    
    /**
     * ヒートマップ情報のクリア
     */
    clear : function() {
    	this.gridHeatMap.clear();
    	return;
    }
};
/**
 * ヒートマップ管理
 *
*/
Ozein.JnMapHMManager = new Class.create();
Ozein.JnMapHMManager.prototype = {
    initialize: function(node) {
        var modules = this._getModule(node);
        //ラジオイベント監視
        for (var i = 0; i<modules.length; i++) {
            Event.observe(modules[i], 'click', this._setHMInfo.bindAsEventListener(this, modules[i]));
        }
    },
    /**
     * 対象ノードの取得
     */    
    _getModule : function (baseNode) {
        return document.getElementsByAttribute('ozein_hm_info', '*', '*');
    },
    /**
     * 賃貸物件情報の取得
     */
    _setHMInfo : function(e, node) {
    if(node.id == "on") {
        g._oprHeatMap(true);
    } else {
           g._oprHeatMap(false);    
    }

    }
};
