var Link = function(){

  function editPath(path){

    return path.slice(0,path.length - 5);
  }

  var over = function(ref){

    var id, path;
    
    id = ref.id;
    path = ref.src

    path = editPath(path);

    document.getElementById(id).src = path + "2.png";
  }

  var out = function(ref){
 
    var id, path;
    
    id = ref.id;
    path = ref.src;

    path = editPath(path);

    document.getElementById(id).src = path + "1.png";
  }

  return { over : over, out : out }
}();

var Inhalt = function(){

  var open = function(id){

    document.getElementById("extra_" + id).style.display = "inline";
    document.getElementById("mehr_" + id).style.display = "none";
  };

  var close = function(id){

    var elem;
    elem = document.getElementById("extra_" + id);
   
   
    elem.parentNode.scrollTop = 0;
    elem.parentNode.style.overflow = "hidden";

    elem.style.display = "none";
    document.getElementById("mehr_" + id).style.display = "inline";


    setTimeout(a=function(){ styleSetting() },1000);

    function styleSetting(){

      elem.parentNode.parentNode.style.overflow = "auto";
    }
  };

  return { close : close, open : open };
}();

var Picasa = function(){

    var close = function(){

      document.getElementById("picasa_container").style.display = "none";
      document.getElementById("shadow").style.display = "none";
      document.getElementById("picasa_obj").src = "";
      document.getElementById("picasa_obj").src = "http://picasaweb.google.at/s/c/bin/slideshow.swf" ;
    }

    var open = function(){

      document.getElementById("picasa_container").style.display = "block";
      document.getElementById("shadow").style.display = "block";
    }

    return { close : close, open : open };
 }()

function hoeheAnpassen(path){

    var agent;
    var body, elem, height;

    body = document.body;
    elem = document.getElementById("main");

    height = body.clientHeight;

    document.styleSheets[0].cssRules ? height -= 140 : height -= 160;  

    elem.style.height = height;  

    if(!path)
    {                                        
	agent = window.navigator;


	if(agent.product == "Gecko")
	{ } //hoeheAnpassen(true);  // chrome bug: first view of the page footer is 40px from bottom. on refresh it is at the bottom 

	if(agent.appName === "Opera")   // opera bug : scrollbar showing automatically where they shouldn't
	{ 
	  document.body.style.overflow = "hidden";
	  document.body.style.overflow = "none";
	}
    }
}

window.onresize=hoeheAnpassen;


