function SalmanPanoControl() {
}
SalmanPanoControl.prototype = new GControl();
SalmanPanoControl.prototype.initialize = function(map) {
	var container = document.createElement("div");
	var panobutton = this.createButton_("Images");
	var xreference = this;
	GEvent.addDomListener(panobutton, "click", function() {
			if (this.panoLayer) {
				if (this.panoLayer.getEnabled()) {
					this.panoLayer.disable();
				} else {
					this.panoLayer.enable();
				}
			} else {
				this.panoLayer = new PanoramioLayer(map);
				this.panoLayer.enable();
			}
			xreference.toggleButton_(panobutton.firstChild, this.panoLayer.getEnabled());
		}
	);
	xreference.toggleButton_(panobutton.firstChild, false);
	container.appendChild(panobutton);
	map.getContainer().appendChild(container);
	return container;
}
SalmanPanoControl.prototype.createButton_ = function(caption) {
	var t = document.createTextNode(caption);
	var c = document.createElement("div");
	c.appendChild(t);
	var b = document.createElement("div");
	b.appendChild(c);
	this.setButtonStyle_(b);
	return b;
}
SalmanPanoControl.prototype.toggleButton_ = function(b, checked) {
	b.style.fontWeight = checked ? "bold" : "";
	b.style.border = "1px solid white";
	if (checked) {
		b.style.borderLeft = "1px solid #b0b0b0";
		b.style.borderTop = "1px solid #b0b0b0";
	} else {
		b.style.borderRight = "1px solid #b0b0b0";
		b.style.borderBottom = "1px solid #b0b0b0";
	}
}
SalmanPanoControl.prototype.getDefaultPosition = function() {
	return new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(112, 7));
}
SalmanPanoControl.prototype.setButtonStyle_ = function(b) {
	b.style.color = "#000000";
	b.style.backgroundColor = "#FFFFFF";
	b.style.font = "small Arial";
	b.style.fontSize = "12px";
	b.style.textAlign = "center";
	b.style.width = "72px";
	b.style.margin = "0px";
	b.style.border = "1px solid black";
	b.style.padding = "0px";
	b.style.cursor = "pointer";
}

