



function tollegroesse() {
	var minhoehe = $('links').getStyle("height");
	var isthoehe = $('inbox').getStyle("height");
	var isthoehevalue = parseInt(isthoehe);
	var minhoehevalue = parseInt( minhoehe);
	if ( isthoehevalue < minhoehevalue ) {
		$('inbox').setStyle({ 'height': minhoehe});
		//alert('hallo ist' + isthoehevalue + " min" + minhoehevalue );
	} else {
		//alert('nono');
	}
}

addLoadEvent(tollegroesse);


function setThumbStyle(caller) {
	var oDiv = document.getElementById('allebilder');
	


	if(oDiv.firstChild) { // check for children
		
	   var oChild = oDiv.firstChild;
	
	   while(oChild) { // run over them
		
	     if(oChild.nodeType==1 && oChild != caller) { // element
	       // oChild is a first level child of oDiv
	       // Do what you want with it here
	
			// works with firefox
			//oChild.style.border="2px solid grey"; 
			
			// works with ie6
			//oChild.style.setAttribute("border", "2px solid #bbb");
			
			// works always - with prototype.js
			$(oChild).setStyle({ border: '2px solid #aaa'});
	     }
	     oChild = oChild.nextSibling;
	   }
	}
	$(caller).setStyle({ border: '2px solid white'});
	//caller.style.border='2px solid white';
}

function setThumbStyleonLoad() {
	// var first = $('erstesbild').firstChild;
	setThumbStyle( $('erstesbild') );
}

function wrappermo() {
 var target = $('wrapper');
 var targetstate = target.getStyle("height");
 var InnerHeight = target.down().getStyle('height');
 //alert("InnerHeight is" + InnerHeight+" outerHeight is" + targetstate);
 if(targetstate =="0px") {
    //alert("shozld open");
    target.morph('height:'+InnerHeight);
    //Effect.SlideDown('wrapper', { duration: 1.0 });
 } else {
   //alert("shozld close");
    target.morph('height:0px');
   //Effect.SlideUp('wrapper', { duration: 3.0 });
 }
		

}

function showhide() {	
	
	var target = $('refding');

	var targetstate = $(target).getStyle("height");

	

	 //alert("height is" + targetstate);
	if(targetstate == "0px") {
		$(target).setStyle({height: 'auto'});
		
	} else {
		$(target).setStyle({height: '0px'});
		
		
	}
	
	
}


function setImage(caller, offset, bildname) {
	
	setThumbStyle(caller);
	//alert("Hallo2");
	var oldImage = document.getElementById("dasbild");
	var oldloc = oldImage.src;
	var anfang = oldloc.substr(0,oldloc.lastIndexOf("/"));
	var neu = anfang + "/" + bildname
	//alert('das neue:' + neu);
	oldImage.src = neu;
	oldImage.style.top=offset + "px"; 
}
var pop = null;

function popdown() {
  if (pop && !pop.closed) pop.close();
}

function popup(obj,w,h) {
  var url = (obj.getAttribute) ? obj.getAttribute('href') : obj.href;
  if (!url) return true;
  w = (w) ? w += 100 : 0;  // 150px*150px is the default size
  h = (h) ? h += 50 : 0;

  var args = 'width='+w+',height='+h+',resizable';
  popdown();
  pop = window.open(url,'',"width=420,height=300,left=400,top=200,scrollbars=yes,location=no,menubar=no,status=no");
  return (pop) ? false : true;
}

window.onunload = popdown;
window.onfocus = popdown;

function clswin() {
close();}


