var div_height;
var factor = 5;
var speed = 20;
var h_max = 300;
var blink = 0;
var blink_speed = 150;
var blink_stop = false;
function pause(millis)
{
var date = new Date();
var curDate = null;
do { curDate = new Date(); }while(curDate-date < millis);
}
function show_div_up(divs)
{
var div;
var shadow;
var pic_up;
var pic_down;
pic_up=document.getElementById('pic_up');
if (pic_up.style.visibility == 'hidden') { return 0; } // ist bereits am hochfahren, oder hochgefahren?
blink_stop=true; // blinken unterbrechen
div = document.getElementById(divs);
div.style.top ='648px';
if (divs=='div_content_inner_kompetenz') { h_max = 320; }
else
if (divs=='div_content_inner_vita') { h_max = 250; }
else
if (divs=='div_content_inner_kooperation') { h_max = 200; }
// Up Bild ausblenden, und damit sicherstellen das nicht nochmal ausgelöst wird
pic_up.style.visibility='hidden';
pic_down=document.getElementById('pic_down');
pic_down.style.top=648-h_max+20+'px';
shadow=document.getElementById(divs+'_head_shadow');
shadow.style.display='block';
div_height=0;
div_up(div);
return true;
}
function div_up(div)
{
if (div_height<=0)
{
div.style.height='0px';
div.style.display='block';
}
if (div_height>h_max)
{
div_height=div_height-factor-factor;
pic=document.getElementById('pic_down');
pic.style.visibility='visible';
return 0;
}
div.style.height=div_height+'px';
div_top=div.style.top;
div_top=div_top.substr(0,div_top.length-2);
div.style.top=div_top-factor+'px';
div_height=div_height+factor;
// function(){myFunction(parameter)}
//setTimeout("div_up(div);", speed);
setTimeout(function(){div_up(div);}, speed);
return true;
}
function show_div_down(divs)
{
if (div_height+5!==h_max) { blink_stop=false; return 0; }
pic=document.getElementById('pic_down');
pic.style.visibility='hidden';
var shadow;
shadow=document.getElementById(divs+'_head_shadow');
if (shadow!=='') { shadow.style.display='none'; }
div=document.getElementById(divs);
div_down(div);
return true;
}
function div_down(div)
{
/*
if (div_height==0)
{
div.style.height='0px';
div.style.display='none';
};
if (div_height<=0)
{
pic=document.getElementById('pic_up');
pic.style.visibility='visible';
return 0;
};
*/
if (div_height<50)
{
pic=document.getElementById('pic_up');
pic.style.visibility='visible';
blink_stop=false;
setTimeout("animate_pic_up()",1000);
return 0;
}
div_top=div.style.top;
div_top=div_top.substr(0,div_top.length-2);
div.style.top=eval(div_top)+factor+'px';
div.style.height=div_height+'px';
div_height=div_height-factor;
setTimeout("div_down(div);", speed);
return true;
}
function do_nothing()
{
return true;
}
//-------------------------------------------------
var title_fade_last_time=0;
var title_fade_div_id=0;
var title_fade_duration=3000;
var title_fade_counter=0;//Math.floor((Math.random()*3));
//alert(title_fade_counter);
//----------------------------------------------
function js_title_fade_animate()
{
var title_fade_div=document.getElementById('div_content_inner_home');
//aktuelle Zeit
var current_time=new Date().getTime();
//Zeitdifferenz seit letztem Aufruf
var passed_time=current_time-title_fade_last_time;
//Zeit abgelaufen?
if(title_fade_div.FadeTimeLeft<=passed_time)
{
//ja
title_fade_div.FadeState=(title_fade_div.FadeState==1)?2:-2;
//volle Transparenz erreicht?
if(title_fade_div.FadeState==-2)
{
//ja: wechsle Titel aus
title_fade_counter++;if(title_fade_counter>2){title_fade_counter=0;}
switch(title_fade_counter)
{
case 1:s="
Wer mehr als die Hälfte seines Einkommens an das Finanzamt abführen muss,
ist mehr darauf bedacht, Steuern zu sparen, als darauf, Geld zu verdienen.
(Hans-Karl Schneider, Volkswirt, Hochschullehrer, geb. 1920)";break;
case 2:s="
Am schwersten auf der Welt zu verstehen ist die Einkommensteuer.
(Albert Einstein, deutscher Physiker und Nobelpreisträger, 1879-1955)";break;
default:s="
Wer die Pflicht hat, Steuern zu zahlen, hat das Recht, Steuern zu sparen!
(BGH-Urteil von 1965)";break;
}
title_fade_div.innerHTML=s;
}
//reinitialisiere Prozess
if (title_fade_counter==1)
{
if (title_fade_div.FadeState==2) { setTimeout(function(){js_title_fade_start("div_content_inner_home");}, 3500); }
else { js_title_fade_start("div_content_inner_home"); }
}
else
{
js_title_fade_start("div_content_inner_home");
}
// js_title_fade_start("div_content_inner_home");
return;
}
//permanenter Aufruf
title_fade_div.FadeTimeLeft=title_fade_div.FadeTimeLeft-passed_time;
var opacity_value=title_fade_div.FadeTimeLeft/title_fade_duration;
if(title_fade_div.FadeState==1){opacity_value=1-opacity_value;}
title_fade_div.style.opacity=opacity_value;
title_fade_div.style.filter="alpha(opacity="+(opacity_value*100)+")";
title_fade_last_time=current_time;
window.setTimeout("js_title_fade_animate()",33);
}
//----------------------------------------------
function js_title_fade_start(div_id)
{
title_fade_div_id=div_id;
var title_fade_div=document.getElementById('div_content_inner_home');if(title_fade_div===null){return;}
var fade_state=title_fade_div.FadeState;
if(fade_state==1 || fade_state==-1)
{
//Transparenz-Zwischenstufe
title_fade_div.FadeState=(fade_state==1)?-1:1;
title_fade_div.FadeTimeLeft=title_fade_duration-title_fade_div.FadeTimeLeft;
}
else
{
//volle Transparenz oder volle Sichtbarkeit
title_fade_div.FadeState=(fade_state==2)?-1:1;
title_fade_div.FadeTimeLeft=title_fade_duration;
title_fade_last_time=new Date().getTime();
window.setTimeout("js_title_fade_animate()",33);
}
}
/*
function animate_pic(pics)
{
if (blink==10) { pic.style.visibility='visible'; return; }
pic=document.getElementById('pic_up');
if (pic.style.visibility=='' || pic.style.visibility=='visible') { pic.style.visibility='hidden'; }
else { pic.style.visibility='visible' };
blink++;
setTimeout("animate_pic()",blink_speed);
}
*/
function animate_pic_up()
{
var pic;
var pic_top;
pic=document.getElementById('pic_up');
if (blink>=8)
{
blink=0;
setTimeout("animate_pic_up()",1000);
return true;
}
if (blink_stop===true)
{
pic.style.top='625px';
return true;
}
pic_top=pic.style.top;
if (pic_top==='') { pic.style.top='625px'; }
pic_top=pic.style.top;
pic_top=pic_top.substr(0,pic_top.length-2);
if (pic_top!=='625') { pic_top=625; }
else { pic_top=pic_top-10; }
pic.style.top=pic_top+'px';
blink++;
setTimeout("animate_pic_up()",blink_speed);
return true;
}
function show_div(divs)
{
div = document.getElementById(divs);
if (div.style.height==='' || div.style.height=='50px') { show_div_up(divs) }
else { show_div_down(divs) }
}