var oPanoramioKML;

function panoramioFotoLoad(oButton)
{
    if (oButton.on)
    {
        oButton.Off();
        oPanoramioKML.hide();
    } else
    {
        oButton.On();
        if (typeof(oPanoramioKML)=="undefined" || !oPanoramioKML.isHidden())
        {
        
            oPanoramioKML = new GLayer("com.panoramio.all");
            //oPanoramioKML = new GGeoXml("http://www.panoramio.com/panoramio.kml?size=small");
            map.addOverlay(oPanoramioKML);
        } else
        {
            oPanoramioKML.show();
        }
    }
}

/*-------------------------------------*/
function LurButton(id,title,offset,p)
{
	var me=this;
	var parent=null;
	var button=null;
	var buttonText=null;
	var on=false;
	if(typeof(id)!="undefined" && typeof(title)!="undefined"  && typeof(title)!="undefined")
		this.Create(id,title,offset,p); 
}
LurButton.prototype.Create = function(id,title,offset,p){
		// ziimeejam buttonu
		this.parent= p;
        this.button = document.createElement("div");
		var b = document.createElement("div");

		var aa = document.createAttribute("class");
		var bb = document.createAttribute("class");
		aa.nodeValue = "button";
		bb.nodeValue = "buttontext";
		this.button.setAttributeNode(aa);
		b.setAttributeNode(bb);
		this.button.appendChild(b);
		id.appendChild(this.button);
       	b.innerHTML = title;
		this.buttonText=b;
      	var pos = new GControlPosition(G_ANCHOR_TOP_RIGHT,offset); 
      	pos.apply(this.button);
		this.Show();
}
LurButton.prototype.addListener=function(cEvent,func){
	GEvent.addDomListener(this.button,cEvent,func);
//	this.button.onclick=func;
}
LurButton.prototype.On=function(){
	this.buttonText.style.fontWeight="bold";
//	this.button.style.borderWidth="1px";
	this.buttonText.style.borderColor="rgb(52, 86, 132) rgb(108, 157, 223) rgb(108, 157, 223) rgb(52, 86, 132)";
	this.on=true;
}
LurButton.prototype.Off=function(){
	this.buttonText.style.fontWeight="normal";
//	this.button.style.border="1px solid black";
	this.buttonText.style.borderColor="white rgb(176, 176, 176) rgb(176, 176, 176) white";
//	this.buttonText.style.borderWidth="1px";
	this.on=false;
}
LurButton.prototype.Show=function(){
	this.button.style.visibility="visible";
}
LurButton.prototype.Hide=function(){
	this.button.style.visibility="hidden";
}
