/*	Google Maps API HtmlControl v1.1.1
	based on code posted on Google Maps API discussion group
	last updated/modified by Martin Pearman 20th January 2008
	
	http://googlemapsapi.martinpearman.co.uk/htmlcontrol
	
	This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

	This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.

	You should have received a copy of the GNU General Public License along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

function HtmlControl($html, $options){
	this._html=$html;
	this.isVisible=true;
	this._isPrintable=false;	
	this._isSelectable=false;
	if($options){
		this.isVisible=($options.visible===false)?false:true;
		this._isPrintable=($options.printable===true)?true:false;
		this._isSelectable=($options.selectable===true)?true:false;
	}
	this.setVisible=function($bool){
		this._div.style.display=($bool)? 'block':'none';
		this.isVisible=$bool;
	};
}
HtmlControl.prototype=new GControl();
HtmlControl.prototype.initialize=function($map){
	this.selectable=function(){
		return this._isSelectable;
	};
	this.printable=function(){
		return this._isPrintable;
	};
	this._div=document.createElement('div');
	this._div.innerHTML=this._html;
	this.setVisible(this.isVisible);
	$map.getContainer().appendChild(this._div);
	return this._div;
};
HtmlControl.prototype.getDefaultPosition=function(){
	return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(7,7));
};
