function alle(ids){var richtung=(schalter.innerHTML=='anzeigen'?'1':'2')
for(var i=0;i<ids.length;i++){slide(ids[i],richtung);}
schalter.innerHTML=(schalter.innerHTML=='anzeigen'?'ausblenden':'anzeigen');}
function animate(elementID,newLeft,newTop,newWidth,newHeight,time,callback)
{var el=leisten[elementID];if(el==null)
return;var cLeft=parseInt(el.style.left);var cTop=parseInt(el.style.top);var cWidth=parseInt(el.style.width);var cHeight=parseInt(el.style.height);var totalFrames=1;if(time>0)
totalFrames=time/40;var fLeft=newLeft-cLeft;if(fLeft!=0)
fLeft/=totalFrames;var fTop=newTop-cTop;if(fTop!=0)
fTop/=totalFrames;var fWidth=newWidth-cWidth;if(fWidth!=0)
fWidth/=totalFrames;var fHeight=newHeight-cHeight;if(fHeight!=0)
fHeight/=totalFrames;doFrame(elementID,cLeft,newLeft,fLeft,cTop,newTop,fTop,cWidth,newWidth,fWidth,cHeight,newHeight,fHeight,callback);}
function doFrame(eID,cLeft,nLeft,fLeft,cTop,nTop,fTop,cWidth,nWidth,fWidth,cHeight,nHeight,fHeight,callback)
{var el=leisten[eID];var parentel=parents[eID];if(el==null)
return;cLeft=moveSingleVal(cLeft,nLeft,fLeft);cTop=moveSingleVal(cTop,nTop,fTop);cWidth=moveSingleVal(cWidth,nWidth,fWidth);cHeight=moveSingleVal(cHeight,nHeight,fHeight);el.style.left=Math.round(cLeft)+'px';el.style.top=Math.round(cTop)+'px';el.style.width=Math.round(cWidth)+'px';el.style.height=Math.round(cHeight)+'px';parentel.style.height=parseInt(el.style.height)+29+'px';if(cLeft==nLeft&&cTop==nTop&&cHeight==nHeight&&cWidth==nWidth)
{if(callback!=null)
callback();return;}
setTimeout(function(){doFrame(eID,cLeft,nLeft,fLeft,cTop,nTop,fTop,cWidth,nWidth,fWidth,cHeight,nHeight,fHeight,callback)},40);}
function moveSingleVal(currentVal,finalVal,frameAmt)
{if(frameAmt==0||currentVal==finalVal)
return finalVal;currentVal+=frameAmt;if((frameAmt>0&&currentVal>=finalVal)||(frameAmt<0&&currentVal<=finalVal))
{return finalVal;}
return currentVal;}
function slide(elementId,richtung)
{var element=leisten[elementId];if((element.style.height!='0px'||richtung==2)&&richtung!=1)
{animate(elementId,0,20,500,0,250,null);element.up=true;element.down=false;}
else
{element.style.display='inline';animate(elementId,0,20,500,135,250,null);element.down=true;element.up=false;}}
function leisten_verstecken(ids){leisten=new Array(ids.length);parents=new Array(ids.length);for(var i=0;i<ids.length;i++){var id=ids[i];var b=document.getElementById('funktionaer_leiste_'+id);b.style.cursor='pointer';leisten[id]=document.getElementById('infos_funktionaer_'+id);leisten[id].style.left=0;leisten[id].style.top=20+'px';leisten[id].style.width=500+'px';leisten[id].style.height=135+'px';parents[id]=document.getElementById('funktionaer_'+id);}
platzhalter_schalter=document.getElementById('js_slide');platzhalter_schalter.innerHTML='<span onclick="javascript:alle(new Array('+ids.join(',')+'));" style="cursor:pointer;text-align:right;display:block;width:500px;color:blue;">• alle <span id="switch_slides">ausblenden</span></span>';schalter=document.getElementById('switch_slides');}
leisten_verstecken(ids);
