var Browser={ IE: !!(window.attachEvent && !window.opera), Opera: !!window.opera, WebKit: navigator.userAgent.indexOf('AppleWebKit/') > -1, Gecko: navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('KHTML') == -1, MobileSafari: !!navigator.userAgent.match(/Apple.*Mobile.*Safari/) } if(Browser.IE){ var setOpacity=function(element,value){ function stripAlpha(filter){ return filter.replace(/alpha\([^\)]*\)/gi,''); } element=document.getElementById(element); var currentStyle=element.currentStyle; if((currentStyle&&!currentStyle.hasLayout)||(!currentStyle&&element.style.zoom=='normal')) element.style.zoom=1; var filter=element.style['filter'],style=element.style; if(value==1||value===''){ (filter=stripAlpha(filter))?style.filter=filter:style.removeAttribute('filter'); return element; }else if(value<0.00001) value=0; style.filter=stripAlpha(filter)+'alpha(opacity='+(value * 100)+')'; style.display=value!=0?'':'none'; return element; }; }else if(Browser.Gecko&&/rv:1\.8\.0/.test(navigator.userAgent)){ function setOpacity(element,value){ element=document.getElementById(element); element.style.opacity=(value==1)?0.999999:(value==='')?'':(value<0.00001)?0:value; element.style.display=value!=0?'':'none'; return element; }; }else if(Browser.WebKit){ function setOpacity(element,value){ element=document.getElementById(element); element.style.opacity=(value==1||value==='')?'':(value<0.00001)?0:value; element.style.display=value!=0?'':'none'; if(value==1) if(element.tagName=='IMG'&&element.width){ element.width++; element.width--; }else try{ var n=document.createTextNode(' '); element.appendChild(n); element.removeChild(n); }catch(e){ } return element; }; }else{ var setOpacity=function(element,value){ element=document.getElementById(element); element.style.opacity=(value==1||value==='')?'':(value<0.00001)?0:value; element.style.display=value!=0?'':'none'; return element; }; } function setZ(element,value){ element=document.getElementById(element); element.style.zIndex=value; return element; } function setRankings(){ for(i in morphList){ setZ(morphList[i],i!=morphIn?i!=morphOut?100:101:102); setOpacity(morphList[i],i==morphOut?1:0); } } function getHeight(element){ return getDimensions(element).height; } function getWidth(element){ return getDimensions(element).width; } function getDimensions(element){ element=document.getElementById(element); var display=element.style['display']; if (display!='none'&&display!=null) // Safari bug return {width: element.offsetWidth, height: element.offsetHeight}; // All *Width and *Height properties give 0 on elements with display none, // so enable the element temporarily var els=element.style; var originalVisibility=els.visibility; var originalPosition=els.position; var originalDisplay=els.display; els.visibility='hidden'; els.position='absolute'; els.display='block'; var originalWidth=element.clientWidth; var originalHeight=element.clientHeight; els.display=originalDisplay; els.position=originalPosition; els.visibility=originalVisibility; return {width: originalWidth, height: originalHeight}; } var morphTime=1000; var morphInterval=100; var morphBreak=3500; var morphStarttime=0; var morphOut=0; var morphIn=0; var morphFct; var morphList=new Array(); var morphInH; var morphOutH; var c=0; var heightFct; while(document.getElementById('morph['+c+']')){ morphList.splice(morphList.length,0,'morph['+c+']'); document.getElementById('morph['+c+']').style.position='absolute'; c++; } //heightFct=window.setInterval("makeHeight()",100); function imgsOk(){ var c=0; while(document.getElementById('morph['+c+']')){ for(i in document.getElementById('morph['+c+']').childNodes){ element=document.getElementById('morph['+c+']').childNodes[i]; if(element.tagName=='IMG') if(!element.complete) return false; } c++; } return true; } function makeHeight(){ window.clearInterval(heightFct); if(imgsOk()){ var c=0; var maxHeight=0; while(document.getElementById('morph['+c+']')){ maxHeight=Math.max(getHeight('morph['+c+']'),maxHeight); c++; } document.getElementById('vorhernachher').style.height=maxHeight+'px'; }else{ heightFct=window.setInterval("makeHeight()",100); } } if(document.getElementById('morph[0]')){ morphOut=0; morphIn=1; setRankings(); morphFct=window.setInterval("morph()",morphBreak); i=document.getElementById('morph['+morphOut+']').childNodes[1].tagName=="IMG"?1:0; morphOutH=parseInt(document.getElementById('morph['+morphOut+']').childNodes[i].className.substr(4,1))+0; morphInH=parseInt(document.getElementById('morph['+morphIn+']').childNodes[i].className.substr(4,1))+0; } var h=new Array(); for(i in document.getElementById('vorhernachher').childNodes){ if(document.getElementById('vorhernachher').childNodes[i].tagName!="IMG") continue; if(document.getElementById('vorhernachher').childNodes[i].className.substr(0,4)=='imgh') h[i]=document.getElementById('vorhernachher').childNodes[i]; } var h1=document.getElementsByClassname function morph(){ var date=new Date(); var current=date.getTime(); window.clearInterval(morphFct); if(!morphStarttime){ morphStarttime=current; morphFct=window.setInterval("morph()",morphInterval); }else if(current>=(morphStarttime+morphTime)){ setOpacity('morph['+morphOut+']',0); setOpacity('morph['+morphIn+']',1); if(morphOutH!=morphInH){ setOpacity('imgh'+morphOutH,0); setOpacity('imgh'+morphInH,1); } morphOut=morphIn; morphIn=morphIn>=morphList.length-1?0:morphIn+1; i=document.getElementById('morph['+morphOut+']').childNodes[1].tagName=="IMG"?1:0; morphOutH=parseInt(document.getElementById('morph['+morphOut+']').childNodes[i].className.substr(4,1))+0; morphInH=parseInt(document.getElementById('morph['+morphIn+']').childNodes[i].className.substr(4,1))+0; morphStarttime=0; setRankings(); morphFct=window.setInterval("morph()",morphBreak); }else{ setOpacity('morph['+morphIn+']',(current-morphStarttime)/morphTime); setOpacity('morph['+morphOut+']',1-((current-morphStarttime)/morphTime)); if(morphOutH!=morphInH){ setOpacity('imgh'+morphOutH,1-(current-morphStarttime)/morphTime); setOpacity('imgh'+morphInH,(current-morphStarttime)/morphTime); } morphFct=window.setInterval("morph()",morphInterval); } }