    var http_request = false;
    var divresizer;

    function getInhalt(url,divh) {
        http_request = false;
        
        
        if (window.XMLHttpRequest) { // Mozilla, Safari,...
            http_request = new XMLHttpRequest();
            if (http_request.overrideMimeType) {
                http_request.overrideMimeType('text/xml');
                // zu dieser Zeile siehe weiter unten
            }
        } else if (window.ActiveXObject) { // IE
            try {
                http_request = new ActiveXObject("Msxml2.XMLHTTP");
            } catch (e) {
                try {
                    http_request = new ActiveXObject("Microsoft.XMLHTTP");
                } catch (e) {}
            }
        }

        if (!http_request) {
            alert('Ende : Kann keine XMLHTTP-Instanz erzeugen');
            return false;
        }
        	http_request.open('GET', '/yesincludes/getorggroup.php?u='+url, true);
        	http_request.onreadystatechange = writeInhalt;
        	http_request.send(null); 
        clearInterval(divresizer);
        divresizer=window.setInterval("resizeDiv("+divh+")",20)
//        window.setTimeout("startScroller("+divh+")",500);
    }

    function writeInhalt() {

        if (http_request.readyState == 4) {
            if (http_request.status == 200) {
                document.getElementById("organcontent").innerHTML=http_request.responseText; 
            }
        }

    }
    
    function resizeDiv(h){
    	currdivheight=document.getElementById("organcontent").style.height.replace("px","")*1;
    		d=h*160;
    		a=currdivheight;
//		alert(d+" "+a);
    	if(currdivheight>d){
			a+=Math.ceil((d-a)/2)
//			a -= Math.ceil(a-(d-a)/5);
    		document.getElementById("organcontent").style.height = a+"px";
    		dh=h;
    		}
    	else if(currdivheight<d){
//			a-=Math.ceil((d-a)/10);
			a = Math.ceil(a+(d-a)/1);
			document.getElementById("organcontent").style.height=a+"px";
//    		document.getElementById("organcontent").style.height = (currdivheight + 20)+"px";
    		dh=h;
    		}
    	else { 
        	clearInterval(divresizer);
        	startScroller(h);
	    	}
    	}

	function startScroller(h){
		if(window.innerHeight<(510+h*160))
	    	Scroller.interval=setInterval('Scroller.scroll('+160+')',10);

		}
/*--------------------------------------------------------------------------
 *  Smooth Scroller Script, version 1.0.1
 *  (c) 2007 Dezinerfolio Inc. <midart@gmail.com>
 *
 *  For details, please check the website : http://dezinerfolio.com/
 *
/*--------------------------------------------------------------------------*/



Scroller = {
	// control the speed of the scroller.
	// dont change it here directly, please use Scroller.speed=50;
	speed:10,

	// returns the current scroll position
	scrollTop: function (){
		body=document.body
	    d=document.documentElement
	    if (body && body.scrollTop) return body.scrollTop
	    if (d && d.scrollTop) return d.scrollTop
	    if (window.pageYOffset) return window.pageYOffset
	    return 0
	},

	// attach an event for an element
	// (element, type, function)
	add: function(event, body, d) {
	    if (event.addEventListener) return event.addEventListener(body, d,false)
	    if (event.attachEvent) return event.attachEvent('on'+body, d)
	},

	// kill an event of an element
	end: function(e){
		if (window.event) {
			window.event.cancelBubble = true
			window.event.returnValue = false
      		return;
    	}
	    if (e.preventDefault && e.stopPropagation) {
	      e.preventDefault()
	      e.stopPropagation()
	    }
	},
	
	
	// move the scroll bar to the particular div.
	scroll: function(d){
		i = window.innerHeight || document.documentElement.clientHeight;
		h=document.body.scrollHeight;
		a = Scroller.scrollTop()
		if(d>a)
			if(h-d>i)
				a+=Math.ceil((d-a)/Scroller.speed)
			else
				a+=Math.ceil((d-a-(h-d))/Scroller.speed)
		else
			a = a+(d-a)/Scroller.speed;
		window.scrollTo(0,a)
	  	if(a==d || Scroller.offsetTop==a)clearInterval(Scroller.interval)
	  	Scroller.offsetTop=a
	},
	// initializer that adds the renderer to the onload function of the window
	init: function(){
		Scroller.add(window,'load', Scroller.render)
		
	}
	

}

// invoke the initializer of the scroller
Scroller.init();


/*------------------------------------------------------------
 *						END OF CODE
/*-----------------------------------------------------------*/
