
function PanoMapTypeControl(opt_opts){this.options=opt_opts||{};this.options.text=this.options.text||"Obrázky";this.options.enable=this.options.enable||false;}
PanoMapTypeControl.prototype=new GControl();PanoMapTypeControl.prototype.initialize=function(map){var container=document.createElement("div");var me=this;var panoDiv=me.createButton_(me.options.text);panoDiv.style.marginRight="8px";panoDiv.style.paddingRight="8px";GEvent.addDomListener(me.checkbox,"click",function(){if(!me.panoLayer){me.panoLayer=new PanoramioLayer(map);}
if(me.checkbox.checked){me.panoLayer.enable();}else{me.panoLayer.disable();}});if(me.options.enable){me.panoLayer=new PanoramioLayer(map);me.checkbox.checked=true;me.panoLayer.enable();}
container.appendChild(panoDiv);map.getContainer().appendChild(container);return container;}
PanoMapTypeControl.prototype.createButton_=function(text){var buttonDiv=document.createElement("div");this.setButtonStyle_(buttonDiv);buttonDiv.style.cssFloat="left";buttonDiv.style.styleFloat="left";var checkbox=document.createElement("input");checkbox.type="checkbox";this.checkbox=checkbox;var textDiv=document.createElement("span");textDiv.appendChild(document.createTextNode(text));textDiv.style.width="6em";buttonDiv.appendChild(checkbox);buttonDiv.appendChild(textDiv);return buttonDiv;}
PanoMapTypeControl.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_TOP_LEFT,new GSize(80,5));}
PanoMapTypeControl.prototype.setButtonStyle_=function(button){button.style.color="#000000";button.style.backgroundColor="white";button.style.font="small Arial";button.style.border="1px solid black";button.style.padding="0px";button.style.margin="0px";button.style.textAlign="center";button.style.fontSize="12px";button.style.cursor="pointer";}
