<!--
var last_content="";
function changeTitel(div) {
    document.getElementById('titel').innerHTML = document.getElementById(div).innerHTML;
}
function changeSubtitel(div) {
    //document.getElementById('subtitel').innerHTML = document.getElementById(div).innerHTML;
}
function changeContent(div) {
    var href = div +'_href';
	if (document.getElementById(div).innerHTML)
	{
	    document.getElementById('project_content').innerHTML = document.getElementById(div).innerHTML;
		if (div != 'annex_map')
		{
		    document.getElementById('project_content').style.height = '100%';
			document.getElementById('project_content').style.backgroundColor = 'white';
		} else {
			document.getElementById('project_content').style.height = '400px';
		}
	    document.getElementById('project_content').style.visibility = 'visible';
	} else {
		document.getElementById('project_content').style.visibility = 'hidden';
	}
	if (document.getElementById(href).className=='active' && document.getElementById('project_content').style.display != 'none')
	{
		document.getElementById('project_content').style.display='none';
	    document.getElementById(href).className='';
	} else {
	    document.getElementById(href).className='active';
		document.getElementById('project_content').style.display='block';
	}
    if (last_content != "" && last_content != div) {
        document.getElementById(last_content +'_href').className='';
    }
	if (typeof(oldpadding) !== 'undefined' && oldpadding)
	{
		document.getElementById('project_content').style.padding=oldpadding;
	}
    last_content=div;
}
var last_pix="";
var last_li="";
function swapMedia(div2) {
    document.getElementById(div2 +'_li').style.display = "inline";
    if (last_li != "" && last_li != div2 && document.getElementById(last_li +'_li')) {
        document.getElementById(last_li +'_li').style.display = "none";
    }
    changeMedia(div2);
}
function changeMedia(div) {
    var href = div +'_href';
    var anno = div +'_anno';
    var copy = div +'_copy';

    document.getElementById('bg').src = document.getElementById(div).src;

    if (document.getElementById(href)) {
        document.getElementById(href).className='active';
    }
    if (last_pix != "" && last_pix != div && document.getElementById(last_pix +'_href')) {
        document.getElementById(last_pix +'_href').className='';
    }

    last_pix=last_li=div;
}
function Hide(id) {
    obj = document.getElementById(id);
    if(obj) {
        obj.style.display = "none";
    }
}
function Show(id) {
    obj = document.getElementById(id);
    if(obj) {
        obj.style.display = "block";
    }
}
function Toggle(id) {
	obj = document.getElementById(id);
	if (obj.style.display == 'none' || !obj.style.display)
	{
		obj.style.display = 'block';
	} else {
		obj.style.display = 'none';
	}
}
    
function makeScrollbar(content,scrollbar,handle,horizontal,ignoreMouse){
    var steps = (horizontal?(content.getScrollSize().x - content.getSize().x):(content.getScrollSize().y - content.getSize().y+55))
    var slider = new Slider(scrollbar, handle, {	
        steps: steps,
        mode: (horizontal?'horizontal':'vertical'),
        onChange: function(step){
            // Scrolls the content element in x or y direction.
            var x = (horizontal?step:0);
            var y = (horizontal?0:step);
            content.scrollTo(x,y);
        }
    }).set(0);
    if( !(ignoreMouse) ){
        // Scroll the content element when the mousewheel is used within the 
        // content or the scrollbar element.
        $$(content, scrollbar).addEvent('mousewheel', function(e){	
            e = new Event(e).stop();
            var step = slider.step - e.wheel * 30;	
            slider.set(step);					
        });
    }
    // Stops the handle dragging process when the mouse leaves the document body.
    $(document.body).addEvent('mouseleave',function(){slider.drag.stop()});
}

