function change_site(dest)
{
    if((current != dest) || current == 'work' && dest == 'work')
    {
        Sound.enable();
        Sound.play('',{replace:true});
        Sound.disable();
    
             if (current == 'begin'  && dest == 'home')    begin_to_home();
        else if (current == 'begin'  && dest == 'about')   begin_to_about();     
        else if (current == 'begin'  && dest == 'work')    begin_to_work();
        else if (current == 'begin'  && dest == 'contact') begin_to_contact();
        else if (current == 'begin'  && dest == 'jobs')    begin_to_jobs('jobs');
        else if (current == 'begin'  && dest == 'imprint') begin_to_jobs('imprint');
    
        else if (current == 'home'  && dest == 'about')   home_to_about();
        else if (current == 'home'  && dest == 'work')    home_to_work();
        else if (current == 'home'  && dest == 'contact') home_to_contact();
        else if (current == 'home'  && dest == 'jobs')    home_to_jobs('jobs');
        else if (current == 'home'  && dest == 'imprint') home_to_jobs('imprint');
        
        else if (current == 'about' && dest == 'home')    about_to_home();
        else if (current == 'about' && dest == 'work')    about_to_work();
        else if (current == 'about' && dest == 'contact') about_to_contact();
        else if (current == 'about' && dest == 'jobs')    about_to_jobs('jobs');
        else if (current == 'about' && dest == 'imprint') about_to_jobs('imprint');
        
        else if (current == 'work' && dest != 'ref')
        {
            if(current_sub != '' && dest != 'work')
            {
                new Effect.Fade($('navi_ref'), { duration: 0.5, from: 1, to: 0  });
                new Effect.Fade($('handy_work_' + current_sub), { duration: 0.5, from: 1, to: 0  });
                new Effect.Fade($('banners_work_' + current_sub), { duration: 0.5, from: 1, to: 0  });
                new Effect.Appear($('handy_down'), { duration: 0.5, from: 0, to: 1  });
                new Effect.Move($('handy'),        { x: 660, y: 780, mode: 'absolute',duration: 1.0});
            }
            
            if (dest == 'work')
            {
                work2_to_work();
                current_sub = '';
            }
            else
            {
                new Effect.Fade($('navi_ref'), { duration: 0.5, from: 1, to: 0  });
                current_sub = '';
                if (dest == 'home')     work_to_home();
                else if (dest == 'about')    work_to_about();
                else if (dest == 'contact')  work_to_contact();
                else if (dest == 'jobs')     work_to_jobs('jobs');
                else if (dest == 'imprint')  work_to_jobs('imprint');
            }                

            
        }
        else if (current == 'work' && dest == 'ref')
        {
            if(current_sub != '')
            {
                new Effect.Fade($('work_container_' + current_sub), { duration: 0.5, from: 1, to: 0  });
                new Effect.Fade($('work_container'), { duration: 0.5, from: 1, to: 0  });
                new Effect.Fade($('handy_work_' + current_sub), { duration: 0.5, from: 1, to: 0  });
                new Effect.Appear($('handy_down'), { duration: 0.5, from: 0, to: 1  });
            }
            work_to_ref();
            current_sub = '';
        }
        else if (current == 'work' && dest == 'work' && current_sub != '') work2_to_work();
        else if (current == 'ref' && dest == 'work')      ref_to_work();
        else if (current == 'ref')
        {
            new Effect.Fade($('ref_brands'), { duration: 0.5, from: 1, to: 0  });
            new Effect.Fade($('navi_ref_active'), { duration: 0.5, from: 1, to: 0  });
            $('navi_ref_active').id = 'navi_ref';
            new Effect.Fade($('work_brands_ref'), { duration: 0.5, from: 1, to: 0  });
            $('navi_work').id = 'navi_work_active';
            if (dest == 'home')     work_to_home();
            else if (dest == 'about')    work_to_about();
            else if (dest == 'contact')  work_to_contact();
            else if (dest == 'jobs')     work_to_jobs('jobs');
            else if (dest == 'imprint')  work_to_jobs('imprint');
        }
        
        else if (current == 'contact' && dest == 'home')    contact_to_home();
        else if (current == 'contact' && dest == 'about')   contact_to_about();
        else if (current == 'contact' && dest == 'work')    contact_to_work();
        else if (current == 'contact' && dest == 'jobs')    contact_to_jobs('jobs');
        else if (current == 'contact' && dest == 'imprint') contact_to_jobs('imprint');
        
        else if ((current == 'jobs' || current == 'imprint') && dest == 'home')     jobs_to_home();
        else if ((current == 'jobs' || current == 'imprint') && dest == 'about')    jobs_to_about();
        else if ((current == 'jobs' || current == 'imprint') && dest == 'work')     jobs_to_work();
        else if ((current == 'jobs' || current == 'imprint') && dest == 'contact')  jobs_to_contact();
        else if (current == 'imprint' && dest == 'jobs')  jobs_to_jobs();
        else if (current == 'jobs' && dest == 'imprint')  jobs_to_jobs();
        else if (current != 'work' && dest == 'ref') alert('Bitte erst auf Work und dann auf Referenzen!');
    }
}

function do_nothing()
{
    test = 1 + 1;
}


/***************From BEGIN *********************/

function begin_to_home()
{
    new Effect.Fade($('banners_begin'),   { duration: 0.5, from: 1, to: 0  });
    new Effect.Appear($('banners_normal'), { duration: 0.5, from: 0, to: 1  });
    new Effect.Appear($('home'), { duration: 0.5, from: 0, to: 1  });
    new Effect.Appear($('notebook_normal'), { duration: 0.5, from: 0, to: 1  });
    new Effect.Fade($('notebook_inaktiv'),   { duration: 0.5, from: 1, to: 0  });
    new Effect.Fade($('handy_begin'),   { duration: 0.5, from: 1, to: 0  });
    new Effect.Appear($('handy_home'), { duration: 0.5, from: 0, to: 1  });
    new Effect.Fade($('begin'),   { duration: 0.5, from: 1, to: 0  });
    new Effect.Fade($('begin_home_block'),   { duration: 0.1, from: 1, to: 0, delay: 0.5  });
    $('notebook_posts').show();
    $('navi_home').id = 'navi_home_active';
    current = 'home';
}

function begin_to_about()
{
    new Effect.Fade($('banners_begin'),   { duration: 0.5, from: 1, to: 0  });
    new Effect.Appear($('banners_normal'), { duration: 0.5, from: 0, to: 1  });
    new Effect.Fade($('handy_begin'),   { duration: 0.5, from: 1, to: 0  });
    new Effect.Fade($('begin'),   { duration: 0.5, from: 1, to: 0  });
    $('navi_home').id = 'navi_home_active';
    home_to_about();
}

function begin_to_work()
{
    new Effect.Fade($('banners_begin'),   { duration: 0.5, from: 1, to: 0  });
    new Effect.Appear($('banners_work'), { duration: 0.5, from: 0, to: 1  });
    new Effect.Fade($('handy_begin'),   { duration: 0.5, from: 1, to: 0  });
    new Effect.Fade($('begin'),   { duration: 0.5, from: 1, to: 0  });
    $('navi_home').id = 'navi_home_active';
    home_to_work();
}

function begin_to_contact()
{
    new Effect.Fade($('banners_begin'),   { duration: 0.5, from: 1, to: 0  });
    new Effect.Appear($('banners_normal'), { duration: 0.5, from: 0, to: 1  });
    new Effect.Fade($('handy_begin'),   { duration: 0.5, from: 1, to: 0  });
    new Effect.Fade($('begin'),   { duration: 0.5, from: 1, to: 0  });
    $('navi_home').id = 'navi_home_active';
    home_to_contact();
}

function begin_to_jobs(text)
{
    new Effect.Fade($('banners_begin'),   { duration: 0.5, from: 1, to: 0  });
    new Effect.Appear($('banners_normal'), { duration: 0.5, from: 0, to: 1  });
    new Effect.Fade($('handy_begin'),   { duration: 0.5, from: 1, to: 0  });
    new Effect.Fade($('begin'),   { duration: 0.5, from: 1, to: 0  });
    $('navi_home').id = 'navi_home_active';
    home_to_jobs(text);    
}
/***************From HOME *********************/

function home_to_about()
{
    $('click_block').style.zIndex = '900';
    $('notebook_posts').hide();
    if($(current + '_admin')) $(current + '_admin').hide();
    new Effect.Parallel([
        new Effect.Move($('banners1'),     { x: 890, y: -90, mode: 'absolute',duration: 1.0}),
        new Effect.Move($('keychain_1'),   { x: -355, y: 435, mode: 'absolute',duration: 0.8,delay: 0.2}),
        new Effect.Move($('ipad'),         { x: 230, y: 175, mode: 'absolute',duration: 1.0}),
        new Effect.Fade($('home'),         { duration: 0.5, from: 1, to: 0  }),
        new Effect.Move($('notebook'),   { x: 1007, y: 720, mode: 'absolute',duration: 1.0}),
        new Effect.Fade($('notebook_normal'),   { duration: 0.5, from: 1, to: 0  }),
        new Effect.Appear($('notebook_inaktiv'), { duration: 0.5, from: 0, to: 1  }),
        new Effect.Fade($('handy_home'),   { duration: 0.5, from: 1, to: 0  }),
        new Effect.Appear($('handy_down'), { duration: 0.5, from: 0, to: 1  }),
        new Effect.Appear($('about_side'), { duration: 0.5, from: 0, to: 1  }),
        new Effect.Move($('handy'),        { x: 660, y: 780, mode: 'absolute',duration: 1.0})
        ], {afterFinish: function(){
                new Effect.Parallel([
                    new Effect.Move($('topbar'), { x: -1, y: 0, mode: 'absolute',duration: 1.0}),
                    new Effect.Move($('bottombar'), { x: -2, y: 386, mode: 'absolute',duration: 1.0})
                    ], {afterFinish: function(){
                        new Effect.Appear($('about'), { duration: 0.5, from: 0, to: 1  });
                        $('click_block').style.zIndex = '-1';
                        }
                    }
                );
              }
           }
    );
    $('navi_about').id = 'navi_about_active';
    $('navi_home_active').id = 'navi_home';
    current = 'about';
}

function home_to_work()
{
    $('click_block').style.zIndex = '900';
    $('notebook_posts').hide();
    if($(current + '_admin')) $(current + '_admin').hide();
    new Effect.Parallel([
        new Effect.Move($('ipad'),         { x: 150, y: 850, mode: 'absolute',duration: 1.0}),
        new Effect.Appear($('navi_ref'), { duration: 0.5, from: 0, to: 1  }),
        new Effect.Fade($('content_container_normal'),   { duration: 0.5, from: 1, to: 0  }),
        new Effect.Appear($('content_container_wonky'), { duration: 0.5, from: 0, to: 1  }),   
        new Effect.Move($('notebook'),   { x: 1007, y: 720, mode: 'absolute',duration: 1.0}),
        new Effect.Fade($('notebook_normal'),   { duration: 0.5, from: 1, to: 0  }),
        new Effect.Appear($('notebook_inaktiv'), { duration: 0.5, from: 0, to: 1  }),
        new Effect.Fade($('home'),   { duration: 0.5, from: 1, to: 0  }),
        new Effect.Fade($('handy_home'),   { duration: 0.5, from: 1, to: 0  }),
        new Effect.Appear($('handy_down'), { duration: 0.5, from: 0, to: 1  }),
        new Effect.Fade($('banners_normal'),   { duration: 0.5, from: 1, to: 0  }),
        new Effect.Appear($('banners_work'), { duration: 0.5, from: 0, to: 1  }),
        new Effect.Move($('banners1'),   { x: 690, y: 335, mode: 'absolute',duration: 1.0}),
        new Effect.Move($('banners2'),   { x: 630, y: 205, mode: 'absolute',duration: 1.0}),
        new Effect.Appear($('work_brands'), { duration: 0.5, from: 0, to: 1  }),
        new Effect.Move($('handy'),        { x: 660, y: 780, mode: 'absolute',duration: 1.0})
        
        ], {afterFinish: function(){
                   $('click_block').style.zIndex = '-1';
                   $('ipad_link').show();
              }
           }
    );
    $('navi_work').id = 'navi_work_active';
    $('navi_home_active').id = 'navi_home';
    current = 'work';
}

function home_to_contact()
{
    $('click_block').style.zIndex = '900';
    $('notebook_posts').hide();
    if($(current + '_admin')) $(current + '_admin').hide();
    new Effect.Parallel
    ([
        new Effect.Move($('banners1'),   { x: 890, y: -90, mode: 'absolute',duration: 1.0}),
        new Effect.Move($('keychain_1'),   { x: -600, y: 435, mode: 'absolute',duration: 0.8,delay: 0.2}),
        new Effect.Move($('ipad'),         { x: 150, y: 780, mode: 'absolute',duration: 1.0}),
        new Effect.Fade($('content_container_normal'),   { duration: 0.5, from: 1, to: 0  }),
        new Effect.Appear($('content_container_wonky'), { duration: 0.5, from: 0, to: 1  }),
        new Effect.Move($('notebook'),   { x: 1007, y: 720, mode: 'absolute',duration: 1.0}),
        new Effect.Fade($('notebook_normal'),   { duration: 0.5, from: 1, to: 0  }),
        new Effect.Appear($('notebook_inaktiv'), { duration: 0.5, from: 0, to: 1  }),
        new Effect.Move($('handy'),        { x: 660, y: 1000, mode: 'absolute',duration: 1.0}),
        new Effect.Fade($('home'),   { duration: 0.5, from: 1, to: 0  })
        ], {afterFinish: function(){
                $('handy_down').show();
                $('click_block').style.zIndex = '-1';
                new Effect.Move($('handy_contact'),        { x: 760, y: 392, mode: 'absolute',duration: 1.0});
                new Effect.Move($('keychain_2'),   { x: 0, y: 135, mode: 'absolute',duration: 0.5});
                new Effect.Appear($('cards'),   { duration: 0.5, from: 0, to: 1, delay: 0.5  });
                new Effect.Appear($('contact_content'),   { duration: 0.5, from: 0, to: 1, delay: 0.5  });
                new Effect.Fade($('handy_home'),   { duration: 0.5, from: 1, to: 0  });
                new Effect.Appear($('handy_down'), { duration: 0.5, from: 0, to: 1  });
                $('ipad_link').show();
                new Effect.Appear($('handy_contact_content'),   { duration: 1.0, from: 0, to: 1, delay: 3.0, 
                  afterFinish: function(){
                    if(current == 'contact')
                    {
                        Sound.enable();
                        Sound.play('audio/ringtone.mp3',{replace:true});
                        setTimeout("Sound.play('audio/ringtone.mp3',{replace:true});",3000);
                        setTimeout("Sound.play('audio/ringtone.mp3',{replace:true});",6000);
                        setTimeout("Sound.play('audio/ringtone.mp3',{replace:true});",9000);
                    }
                  }
                
                });
              }
           }
    );
    $('navi_contact').id = 'navi_contact_active';
    $('navi_home_active').id = 'navi_home';
    current = 'contact';
}

function home_to_jobs(text)
{
    $('click_block').style.zIndex = '900';
    $('notebook_posts').hide();
    if($(current + '_admin')) $(current + '_admin').hide();
    new Effect.Parallel([
        new Effect.Move($('banners1'),     { x: 890, y: -90, mode: 'absolute',duration: 1.0}),
        new Effect.Move($('keychain_1'),   { x: -305, y: 435, mode: 'absolute',duration: 0.8,delay: 0.2}),
        new Effect.Move($('ipad'),         { x: 280, y: 175, mode: 'absolute',duration: 1.0}),
        new Effect.Move($('notebook'),   { x: 1007, y: 720, mode: 'absolute',duration: 1.0}),
        new Effect.Fade($('notebook_normal'),   { duration: 0.5, from: 1, to: 0  }),
        new Effect.Appear($('notebook_inaktiv'), { duration: 0.5, from: 0, to: 1  }),
        new Effect.Fade($('handy_home'),   { duration: 0.5, from: 1, to: 0  }),
        new Effect.Appear($('handy_down'), { duration: 0.5, from: 0, to: 1  }),
        new Effect.Fade($('home'),   { duration: 0.5, from: 1, to: 0  }),
        new Effect.Move($('handy'),        { x: 660, y: 780, mode: 'absolute',duration: 1.0})
        ], {afterFinish: function(){
                $('click_block').style.zIndex = '-1';
                new Effect.Move($('topbar'), { x: -1, y: 0, mode: 'absolute',duration: 1.0});
                new Effect.Appear($(text),   { duration: 0.5, from: 0, to: 1, delay: 0.5  });
                if(text == 'jobs') $('ipad_title').innerHTML = 'Jobs';
                else if(text == 'imprint') $('ipad_title').innerHTML = 'Impressum';
              }
           }
    );
    $('navi_home_active').id = 'navi_home';
    $('navi_' + text + '_notebook').id = 'navi_' + text + '_notebook_active';
    if(text == 'jobs') $('navi_jobs').id = 'navi_jobs_active';
    
    current = text;
}

/***************From ABOUT*********************/

function about_to_home()
{
    $('click_block').style.zIndex = '900';
    if(current_sub != '') new Effect.Fade($(current_sub + '_side'),   { duration: 0.5, from: 1, to: 0  });
    if(current_sub != '') new Effect.Move($(current_sub),  { x: 350, y: 33, mode: 'absolute',duration: 1.0});
    new Effect.Parallel([
        new Effect.Move($('banners1'),     { x: 860, y: 15, mode: 'absolute',duration: 1.0}),
        new Effect.Move($('keychain_1'),   { x: -305, y: 435, mode: 'absolute',duration: 0.8,delay: 0.2}),
        new Effect.Move($('ipad'),         { x: 280, y: 175, mode: 'absolute',duration: 1.0}),
        new Effect.Move($('notebook'),   { x: 1007, y: 490, mode: 'absolute',duration: 1.0}),
        new Effect.Appear($('notebook_normal'), { duration: 0.5, from: 0, to: 1  }),
        new Effect.Fade($('notebook_inaktiv'),   { duration: 0.5, from: 1, to: 0  }),
        new Effect.Appear($('handy_home'), { duration: 0.5, from: 0, to: 1  }),
        new Effect.Fade($('handy_down'),   { duration: 0.5, from: 1, to: 0  }),
        new Effect.Fade($('about'),   { duration: 0.5, from: 1, to: 0  }),
        new Effect.Fade($('about_side'),   { duration: 0.5, from: 1, to: 0  }),
        new Effect.Move($('bottombar'),{ x: -2, y: 471, mode: 'absolute',duration: 1.0}),
        new Effect.Move($('topbar'),{ x: -1, y: -33, mode: 'absolute',duration: 1.0}),
        new Effect.Move($('handy'),        { x: 660, y: 520, mode: 'absolute',duration: 1.0})
        
        ], {afterFinish: function(){
                $('handy_home').show();
                $('back').hide();
                $('click_block').style.zIndex = '-1';
                $('notebook_posts').show();
                    if(current_sub != '')
                    {
                        new Effect.Move($('about'),{ x: 0, y: 33, mode: 'absolute',duration: 1.0});
                        $('ipad_title').innerHTML = 'About';
                        team_member_hide();
                    }
                    new Effect.Appear($('home'), { duration: 0.5, from: 0, to: 1  });
                    $(current_sub.slice(6)).className = 'v1';
                    current_sub = '';
              }
           }
    );
    $('navi_home').id = 'navi_home_active';
    $('navi_about_active').id = 'navi_about';
    current = 'home';
}

function about_to_work()
{
    $('click_block').style.zIndex = '900';
    if(current_sub != '') new Effect.Fade($(current_sub + '_side'),   { duration: 0.5, from: 1, to: 0  });
    new Effect.Parallel([
        new Effect.Move($('keychain_1'), { x: -305, y: 435, mode: 'absolute',duration: 0.2,delay: 0.8}),
        new Effect.Appear($('navi_ref'), { duration: 0.5, from: 0, to: 1  }),
        new Effect.Fade($('content_container_normal'),   { duration: 0.5, from: 1, to: 0  }),
        new Effect.Appear($('content_container_wonky'), { duration: 0.5, from: 0, to: 1  }),
        new Effect.Fade($('banners_normal'),   { duration: 0.5, from: 1, to: 0  }),
        new Effect.Appear($('banners_work'), { duration: 0.5, from: 0, to: 1  }),
        new Effect.Move($('banners1'),   { x: 690, y: 335, mode: 'absolute',duration: 1.0}),
        new Effect.Move($('banners2'),   { x: 630, y: 205, mode: 'absolute',duration: 1.0}),
        new Effect.Appear($('work_brands'), { duration: 0.5, from: 0, to: 1  }),
        new Effect.Fade($('about'),   { duration: 0.5, from: 1, to: 0  }),
        new Effect.Fade($('about_side'),   { duration: 0.5, from: 1, to: 0  }),
        new Effect.Move($('ipad'),       { x: 150, y: 850, mode: 'absolute',duration: 1.0})
        ], {afterFinish: function(){
                    $('click_block').style.zIndex = '-1';
                    new Effect.Move($('bottombar'),{ x: -2, y: 471, mode: 'absolute',duration: 1.0});
                    new Effect.Move($('topbar'),{ x: -1, y: -33, mode: 'absolute',duration: 1.0});
                    $('ipad_link').show();
                    $('back').hide();
                    if(current_sub != '')
                    {
                        new Effect.Move($(current_sub),  { x: 350, y: 33, mode: 'absolute',duration: 1.0});
                        new Effect.Move($('about'),{ x: 0, y: 33, mode: 'absolute',duration: 1.0});
                        team_member_hide();
                        $('ipad_title').innerHTML = 'About';
                        $(current_sub.slice(6)).className = 'v1';
                        current_sub = '';
                    }
              }
           }
    );
    $('navi_work').id = 'navi_work_active';
    $('navi_about_active').id = 'navi_about';
    current = 'work';
}

function about_to_contact()
{
    $('click_block').style.zIndex = '900';
    if(current_sub != '') new Effect.Fade($(current_sub + '_side'),   { duration: 0.5, from: 1, to: 0  });
    new Effect.Parallel
    ([
        new Effect.Move($('banners1'),   { x: 890, y: -90, mode: 'absolute',duration: 1.0}),
        new Effect.Move($('keychain_1'),   { x: -600, y: 435, mode: 'absolute',duration: 0.8,delay: 0.2}),
        new Effect.Move($('ipad'),         { x: 150, y: 780, mode: 'absolute',duration: 1.0}),
        new Effect.Fade($('content_container_normal'),   { duration: 0.5, from: 1, to: 0  }),
        new Effect.Appear($('content_container_wonky'), { duration: 0.5, from: 0, to: 1  }),
        new Effect.Fade($('about_side'),   { duration: 0.5, from: 1, to: 0  }),
        new Effect.Move($('handy'),        { x: 660, y: 1000, mode: 'absolute',duration: 1.0})
        ], {afterFinish: function(){
                $('handy_down').show();
                $('click_block').style.zIndex = '-1';
                $('ipad_link').show();
                new Effect.Move($('handy_contact'),        { x: 760, y: 392, mode: 'absolute',duration: 1.0});
                new Effect.Move($('keychain_2'),   { x: 0, y: 135, mode: 'absolute',duration: 0.5});
                new Effect.Appear($('cards'),   { duration: 0.5, from: 0, to: 1, delay: 0.5  });
                new Effect.Appear($('contact_content'),   { duration: 0.5, from: 0, to: 1, delay: 0.5  });
                new Effect.Move($('topbar'), { x: -1, y: -33, mode: 'absolute',duration: 1.0}),
                new Effect.Move($('bottombar'), { x: -2, y: 466, mode: 'absolute',duration: 1.0})
                new Effect.Fade($('about'),   { duration: 0.5, from: 1, to: 0  });
                $('back').hide();
                    if(current_sub != '')
                    {
                        new Effect.Move($(current_sub),  { x: 350, y: 33, mode: 'absolute',duration: 1.0});
                        team_member_hide();
                        new Effect.Move($('about'),{ x: 0, y: 33, mode: 'absolute',duration: 1.0});
                        $(current_sub.slice(6)).className = 'v1';
                        current_sub = '';
                        $('ipad_title').innerHTML = 'About'; 
                    }
                    new Effect.Appear($('handy_contact_content'),   { duration: 1.0, from: 0, to: 1, delay: 3.0, 
                      afterFinish: function(){
                        if(current == 'contact')
                        {
                            Sound.enable();
                            Sound.play('audio/ringtone.mp3',{replace:true});
                            setTimeout("Sound.play('audio/ringtone.mp3',{replace:true});",3000);
                            setTimeout("Sound.play('audio/ringtone.mp3',{replace:true});",6000);
                            setTimeout("Sound.play('audio/ringtone.mp3',{replace:true});",9000);
                        }
                      }
                    
                    });
              }
           }
    );
    $('navi_contact').id = 'navi_contact_active';
    $('navi_about_active').id = 'navi_about';
    current = 'contact';
}

function about_to_jobs(text)
{
    $('click_block').style.zIndex = '900';
    new Effect.Fade($('back'),   { duration: 0.5, from: 1, to: 0  });
    if(current_sub != '')
    {
        new Effect.Move($(current_sub),  { x: 350, y: 33, mode: 'absolute',duration: 1.0});
        new Effect.Fade($(current_sub + '_side'),   { duration: 0.5, from: 1, to: 0  });
        $(current_sub.slice(6)).className = 'v1';
    }

    new Effect.Parallel([
        new Effect.Move($('banners1'),     { x: 890, y: -90, mode: 'absolute',duration: 1.0}),
        new Effect.Move($('keychain_1'),   { x: -305, y: 435, mode: 'absolute',duration: 0.8,delay: 0.2}),
        new Effect.Fade($('about_side'),   { duration: 0.5, from: 1, to: 0  }),
        new Effect.Fade($('about'),   { duration: 0.5, from: 1, to: 0  }),
        new Effect.Move($('bottombar'),{ x: -2, y: 471, mode: 'absolute',duration: 1.0}),
        new Effect.Move($('ipad'),         { x: 280, y: 175, mode: 'absolute',duration: 1.0})
        ], {afterFinish: function(){
                $('click_block').style.zIndex = '-1';
                new Effect.Move($('about'),{ x: 0, y: 33, mode: 'absolute',duration: 1.0});
                new Effect.Appear($(text),   { duration: 0.5, from: 0, to: 1, delay: 0.5  });
                team_member_hide();
                $('back').hide();
                current_sub = '';
                if(text == 'jobs') $('ipad_title').innerHTML = 'Jobs';
                else if(text == 'imprint') $('ipad_title').innerHTML = 'Impressum';
              }
           }
    );
    $('navi_about_active').id = 'navi_about';
    $('navi_' + text + '_notebook').id = 'navi_' + text + '_notebook_active';
    if(text == 'jobs') $('navi_jobs').id = 'navi_jobs_active';
    current = text;
}

function change_about(id)
{	
    if(id == 'about_leistungen') $('ipad_title').innerHTML = 'About / Leistungen';
    else if(id == 'about_agentur') $('ipad_title').innerHTML = 'About / Agentur';
    else if(id == 'about_team') $('ipad_title').innerHTML = 'About / Management';
    else $('ipad_title').innerHTML = 'About';
    current = 'about';
    if(id != '')
    {
        if(current_sub == '')
        {
            new Effect.Move($('about'),  { x: -350, y: 33, mode: 'absolute',duration: 1.0});
            new Effect.Move($(id),{ x: 0, y: 33, mode: 'absolute',duration: 1.0});
            new Effect.Fade($('about_side'),   { duration: 0.5, from: 1, to: 0, delay: 0.5  });
			//var temp = (id=='about_management') ? "about_team" : id;
            new Effect.Appear($(id + '_side'),   { duration: 0.5, from: 0, to: 1, delay: 0.5  });
            new Effect.Appear($('back'),   { duration: 0.5, from: 0, to: 1, delay: 0.5  });
            //team_member_hide();
			theId = (id == "about_management") ? "about_team" : id; // Fix
            $(theId.slice(6)).className = 'v2';
            current_sub = id;
        }
        else if(current_sub != '')
        {
            new Effect.Move($(current_sub),  { x: 350, y: 33, mode: 'absolute',duration: 1.0});
            new Effect.Move($(id),{ x: 0, y: 33, mode: 'absolute',duration: 1.0});
            new Effect.Move($('bottombar'),{ x: -2, y: 386, mode: 'absolute',duration: 1.0});
            //if ((current_sub!='about_team'&&id!='about_management') || (id!='about_team'&&current_sub!='about_management')) {
				//var temp1 = (current_sub=='about_management') ? "about_team" : current_sub;
				new Effect.Fade($(current_sub + '_side'),   { duration: 0.5, from: 1, to: 0  });
			//}
            new Effect.Fade($('about_side'),   { duration: 0.5, from: 1, to: 0, delay: 0.5  });
            //if ((current_sub!='about_team'&&id!='about_management') || (id!='about_team'&&current_sub!='about_management')) {
				//var temp2 = (id=='about_management') ? "about_team" : id;
				new Effect.Appear($(id + '_side'),   { duration: 0.5, from: 0, to: 1, delay: 0.5});
			//}
            //team_member_hide();
			theId = (id == "about_management") ? "about_team" : id; // Fix
			theCurrent_sub = (current_sub == "about_management") ? "about_team" : current_sub; // Fix
            $(theId.slice(6)).className = 'v2';
            $(theCurrent_sub.slice(6)).className = 'v1';
            current_sub = id;
        }
    }
    else if (current_sub == "about_team")
    {
        change_about('about_management');
    }
	else
    {
        new Effect.Move($(current_sub),  { x: 350, y: 33, mode: 'absolute',duration: 1.0});
        new Effect.Move($('about'),{ x: 0, y: 33, mode: 'absolute',duration: 1.0});
        new Effect.Fade($(current_sub + '_side'),   { duration: 0.5, from: 1, to: 0  });
        new Effect.Appear($('about_side'),   { duration: 0.5, from: 0, to: 1, delay: 0.5  });
        new Effect.Fade($('back'),   { duration: 0.5, from: 1, to: 0, delay: 0.5  });
        //team_member_hide();
		theCurrent_sub = (current_sub == "about_management") ? "about_team" : current_sub; // Fix
        $(theCurrent_sub.slice(6)).className = 'v1';
        current_sub = '';
    }
}


function change_team_member(from,to)
{
	new Effect.Fade($('team_member' + from),   { duration: 0.5, from: 1, to: 0  });
	new Effect.Fade($('team' + from),   { duration: 0.5, from: 1, to: 0  });
	new Effect.Appear($('team_member' + to), { duration: 0.5, from: 0, to: 1  });
	new Effect.Appear($('team' + to), { duration: 0.5, from: 0, to: 1  });
	current_team_member = to;
}

function goToTeamMember(id) {
	change_about('about_team');
	var from = (id == 1 && current_team_member == 1) ? 2 : current_team_member;
	change_team_member(from,id);
	$('team_member' + current_team_member).show();
}

function team_member_hide()
{
    new Effect.Parallel([
        new Effect.Fade($('team_member' + current_team_member))
        ]/*, {afterFinish: function(){
                $('team_member' + current_team_member).hide();
                $('team_member1').show();
                
                if($('team1')) $('team1').hide();
                if($('team2')) $('team2').hide();
                if($('team3')) $('team3').hide();
                if($('team4')) $('team4').hide();
                if($('team5')) $('team5').hide();
                if($('team6')) $('team6').hide();
                if($('team7')) $('team7').hide();
                if($('team8')) $('team8').hide();
                if($('team9')) $('team9').hide();
              }
           } */
    );
    
    //current_team_member = 1;
}


/***************From WORK*********************/

function work_to_home()
{
    $('click_block').style.zIndex = '900';
    work_hide_banners();
    work_hide_content();
    if(current_sub != '') new Effect.Fade($('handy_work_' + current_sub), { duration: 0.5, from: 1, to: 0  });
    
    new Effect.Parallel([
        new Effect.Move($('ipad'),         { x: 280, y: 175, mode: 'absolute',duration: 1.0}),
        new Effect.Move($('notebook'),   { x: 1007, y: 490, mode: 'absolute',duration: 1.0}),
        new Effect.Fade($('notebook_inaktiv'),   { duration: 0.5, from: 1, to: 0  }),
        new Effect.Appear($('notebook_normal'), { duration: 0.5, from: 0, to: 1  }),
        new Effect.Fade($('content_container_wonky'),   { duration: 0.5, from: 1, to: 0  }),
        new Effect.Appear($('content_container_normal'), { duration: 0.5, from: 0, to: 1  }),
        new Effect.Appear($('handy_home'), { duration: 0.5, from: 0, to: 1  }),
        new Effect.Fade($('handy_down'),   { duration: 0.5, from: 1, to: 0  }),
        new Effect.Fade($('banners_work'),   { duration: 0.5, from: 1, to: 0  }),
        new Effect.Appear($('banners_normal'), { duration: 0.5, from: 0, to: 1  }),
        new Effect.Move($('banners1'),   { x: 860, y: 15, mode: 'absolute',duration: 1.0}),
        new Effect.Move($('banners2'),   { x: 1300, y: 205, mode: 'absolute',duration: 1.0}),
        new Effect.Fade($('work_brands'), { duration: 0.5, from: 1, to: 0  }),
        new Effect.Fade($('ref_brands'), { duration: 0.5, from: 1, to: 0  }), 
        new Effect.Move($('handy'),        { x: 660, y: 520, mode: 'absolute',duration: 1.0})
        ], {afterFinish: function(){
                $('handy_home').show();
                $('click_block').style.zIndex = '-1';
                $('ipad_link').hide();
                new Effect.Appear($('home'), { duration: 0.5, from: 0, to: 1  });
                $('notebook_posts').show();
                
              }
           }
    );
    $('navi_home').id = 'navi_home_active';
    $('navi_work_active').id = 'navi_work';
    current = 'home';
}

function work_to_about()
{
    $('click_block').style.zIndex = '900';
    work_hide_banners();
    work_hide_content();
    $('ipad_link').hide();
    new Effect.Parallel([
        new Effect.Move($('banners1'),   { x: 890, y: -90, mode: 'absolute',duration: 1.0}),
        new Effect.Move($('keychain_1'), { x: -355, y: 435, mode: 'absolute',duration: 0.2,delay: 0.8}),
        new Effect.Move($('ipad'),       { x: 230, y: 175, mode: 'absolute',duration: 1.0}),
        new Effect.Fade($('content_container_wonky'),   { duration: 0.5, from: 1, to: 0  }),
        new Effect.Appear($('content_container_normal'), { duration: 0.5, from: 0, to: 1  }),
        new Effect.Fade($('banners_work'),   { duration: 0.5, from: 1, to: 0  }),
        new Effect.Appear($('banners_normal'), { duration: 0.5, from: 0, to: 1  }),
        new Effect.Move($('banners2'),   { x: 1300, y: 205, mode: 'absolute',duration: 1.0}),
        new Effect.Fade($('work_brands'), { duration: 0.5, from: 1, to: 0  }),
        new Effect.Appear($('about_side'), { duration: 0.5, from: 0, to: 1  }),
        new Effect.Fade($('ref_brands'), { duration: 0.5, from: 1, to: 0  })
        ], {afterFinish: function(){
                $('click_block').style.zIndex = '-1';
                new Effect.Parallel([
                    new Effect.Move($('topbar'), { x: -1, y: 0, mode: 'absolute',duration: 1.0}),
                    new Effect.Move($('bottombar'), { x: -2, y: 386, mode: 'absolute',duration: 1.0})
                    ], {afterFinish: function(){
                        $('ipad_title').innerHTML = 'About';
                        new Effect.Appear($('about'), { duration: 0.5, from: 0, to: 1  });
                        
                        $('click_block').style.zIndex = '-1';
                        }
                    }
                );
              }
           }
    );
    $('navi_about').id = 'navi_about_active';
    $('navi_work_active').id = 'navi_work';
    current = 'about';
}

function work_to_contact()
{
    $('click_block').style.zIndex = '900';
    work_hide_banners();
    work_hide_content();
    new Effect.Parallel
    ([
        new Effect.Move($('banners1'),   { x: 890, y: -90, mode: 'absolute',duration: 1.0}),
        new Effect.Move($('keychain_1'),   { x: -600, y: 435, mode: 'absolute',duration: 0.8,delay: 0.2}),
        new Effect.Move($('ipad'),         { x: 150, y: 780, mode: 'absolute',duration: 1.0}),
        new Effect.Move($('handy'),        { x: 660, y: 1000, mode: 'absolute',duration: 1.0}),
        new Effect.Fade($('banners_work'),   { duration: 0.5, from: 1, to: 0  }),
        new Effect.Appear($('banners_normal'), { duration: 0.5, from: 0, to: 1  }),
        new Effect.Move($('banners2'),   { x: 1300, y: 205, mode: 'absolute',duration: 1.0}),
        new Effect.Fade($('work_brands'), { duration: 0.5, from: 1, to: 0  }),
        new Effect.Fade($('ref_brands'), { duration: 0.5, from: 1, to: 0  })
        ], {afterFinish: function(){
                $('handy_down').show();
                new Effect.Move($('handy_contact'),        { x: 760, y: 392, mode: 'absolute',duration: 1.0});
                new Effect.Move($('keychain_2'),   { x: 0, y: 135, mode: 'absolute',duration: 0.5});
                new Effect.Appear($('cards'),   { duration: 0.5, from: 0, to: 1, delay: 0.5  });
                new Effect.Appear($('contact_content'),   { duration: 0.5, from: 0, to: 1, delay: 0.5  });
                $('click_block').style.zIndex = '-1';
                new Effect.Appear($('handy_contact_content'),   { duration: 1.0, from: 0, to: 1, delay: 3.0, 
                  afterFinish: function(){
                    if(current == 'contact')
                    {
                        Sound.enable();
                        Sound.play('audio/ringtone.mp3',{replace:true});
                        setTimeout("Sound.play('audio/ringtone.mp3',{replace:true});",3000);
                        setTimeout("Sound.play('audio/ringtone.mp3',{replace:true});",6000);
                        setTimeout("Sound.play('audio/ringtone.mp3',{replace:true});",9000);
                    }
                  }
                });
              }
           }
    );
    $('navi_contact').id = 'navi_contact_active';
    $('navi_work_active').id = 'navi_work';
    current = 'contact';
}

function work_to_jobs(text)
{
    $('click_block').style.zIndex = '900';
    work_hide_banners();
    work_hide_content();
    $('ipad_link').hide();
    $('ipad_title').innerHTML = 'Jobs';
    new Effect.Parallel([
        new Effect.Move($('banners1'),     { x: 890, y: -90, mode: 'absolute',duration: 1.0}),
        new Effect.Move($('ipad'),         { x: 280, y: 175, mode: 'absolute',duration: 1.0}),
        new Effect.Fade($('banners_work'),   { duration: 0.5, from: 1, to: 0  }),
        new Effect.Appear($('banners_normal'), { duration: 0.5, from: 0, to: 1  }),
        new Effect.Move($('banners2'),   { x: 1300, y: 205, mode: 'absolute',duration: 1.0}),
        new Effect.Fade($('work_brands'), { duration: 0.5, from: 1, to: 0  }),
        new Effect.Fade($('ref_brands'), { duration: 0.5, from: 1, to: 0  }),
        new Effect.Fade($('content_container_wonky'),   { duration: 0.5, from: 1, to: 0  }),
        new Effect.Appear($('content_container_normal'), { duration: 0.5, from: 0, to: 1  })
        ], {afterFinish: function(){
                $('click_block').style.zIndex = '-1';
                new Effect.Move($('topbar'), { x: -1, y: 0, mode: 'absolute',duration: 1.0});
                new Effect.Appear($(text),   { duration: 0.5, from: 0, to: 1, delay: 0.5  });
                if(text == 'jobs') $('ipad_title').innerHTML = 'Jobs';
                else if(text == 'imprint') $('ipad_title').innerHTML = 'Impressum';
              }
           }
    );
    $('navi_work_active').id = 'navi_work';
    $('navi_' + text + '_notebook').id = 'navi_' + text + '_notebook_active';
    if(text == 'jobs') $('navi_jobs').id = 'navi_jobs_active';
    current = text;
}

function work_to_work2(work)
{
    Sound.enable();
    Sound.play('',{replace:true});
    Sound.disable();
    $('work_container_' + work).show();
    
    $('click_block').style.zIndex = '900';
    new Effect.Parallel([
         new Effect.Fade($('work_brands'), { duration: 0.5, from: 1, to: 0  }),
         new Effect.Appear($('work_container'), { duration: 0.5, from: 0, to: 1  }),
         new Effect.Move($('banners1'),   { x: 690, y: 135, mode: 'absolute',duration: 1.0}),
         new Effect.Move($('banners2'),   { x: 1300, y: 205, mode: 'absolute',duration: 1.0}),
         new Effect.Appear($('banners_work_' + work), { duration: 0.5, from: 0, to: 1  }),
         new Effect.Fade($('banners_work'), { duration: 0.5, from: 1, to: 0  }),
         new Effect.Appear($('handy_work_' + work), { duration: 0.5, from: 0, to: 1  }),
         new Effect.Fade($('handy_down'), { duration: 0.5, from: 1, to: 0  }),
         new Effect.Move($('handy'), { x: 660, y: 450, mode: 'absolute',duration: 1.0})
        ], {afterFinish: function(){
                current_sub = work;
                $('click_block').style.zIndex = '-1';
              }
           }
    );
}

function work2_to_work()
{
    Sound.enable();
    Sound.play('',{replace:true});
    Sound.disable();
    work_hide_banners();
    $('click_block').style.zIndex = '900';
    new Effect.Parallel([
        new Effect.Fade($('work_container'), { duration: 0.5, from: 1, to: 0  }),
        new Effect.Appear($('work_brands'), { duration: 0.5, from: 0, to: 1  }),
        new Effect.Move($('banners1'),   { x: 690, y: 335, mode: 'absolute',duration: 1.0}),
        new Effect.Move($('banners2'),   { x: 630, y: 205, mode: 'absolute',duration: 1.0}),
        new Effect.Appear($('handy_down'), { duration: 0.5, from: 0, to: 1  }),
        new Effect.Fade($('banners_work_' + current_sub), { duration: 0.5, from: 1, to: 0  }),
        new Effect.Fade($('handy_work_' + current_sub), { duration: 0.5, from: 1, to: 0  }),
        new Effect.Appear($('banners_work'), { duration: 0.5, from: 0, to: 1  }),
        new Effect.Move($('handy'),        { x: 660, y: 780, mode: 'absolute',duration: 1.0})
        ], {afterFinish: function(){
                work_hide_content();
                current_sub = '';
                $('click_block').style.zIndex = '-1';
              }
           }
    );
}

function work_to_ref()
{
    new Effect.Move($('banners1'),   { x: 690, y: -500, mode: 'absolute',duration: 1.0});
    new Effect.Move($('banners2'),   { x: 1300, y: 205, mode: 'absolute',duration: 1.0});
    new Effect.Appear($('ref_brands'), { duration: 0.5, from: 0, to: 1  });
    new Effect.Move($('handy'),        { x: 660, y: 780, mode: 'absolute',duration: 1.0});
    $('work_brands').hide();
    $('work_brands_ref').show();
    current = 'ref';
    $('navi_ref').id = 'navi_ref_active';
    $('navi_work_active').id = 'navi_work';
    work_hide_content();
}

function ref_to_work()
{
    new Effect.Fade($('ref_brands'), { duration: 0.5, from: 1, to: 0  });
    new Effect.Move($('banners1'),   { x: 690, y: 335, mode: 'absolute',duration: 1.0});
    new Effect.Move($('banners2'),   { x: 630, y: 205, mode: 'absolute',duration: 1.0});
    $('work_brands_ref').hide();
    $('work_brands').show();
    current = 'work';
    $('navi_ref_active').id = 'navi_ref';
    $('navi_work').id = 'navi_work_active';
}

function work_hide_banners()
{
    if($('banners_work_case1').style.display == '') new Effect.Fade($('banners_work_case1'), { duration: 0.5, from: 1, to: 0  });
    if($('banners_work_case2').style.display == '') new Effect.Fade($('banners_work_case2'), { duration: 0.5, from: 1, to: 0  });
    if($('banners_work_case3').style.display == '') new Effect.Fade($('banners_work_case3'), { duration: 0.5, from: 1, to: 0  });
    if($('banners_work_case4').style.display == '') new Effect.Fade($('banners_work_case4'), { duration: 0.5, from: 1, to: 0  });
    if($('banners_work_case5').style.display == '') new Effect.Fade($('banners_work_case5'), { duration: 0.5, from: 1, to: 0  });
    if($('banners_work_case6').style.display == '') new Effect.Fade($('banners_work_case6'), { duration: 0.5, from: 1, to: 0  });
}

function work_hide_content()
{
    $('work_container_case1').hide();
    if($('work_container_case1_admin')) $('work_container_case1_admin').hide();
    $('work_container_case2').hide();
    if($('work_container_case2_admin')) $('work_container_case2_admin').hide();
    $('work_container_case3').hide();
    if($('work_container_case3_admin')) $('work_container_case3_admin').hide();
    $('work_container_case4').hide();
    if($('work_container_case4_admin')) $('work_container_case4_admin').hide();
    $('work_container_case5').hide();
    if($('work_container_case5_admin')) $('work_container_case5_admin').hide();
    $('work_container_case6').hide();
    if($('work_container_case6_admin')) $('work_container_case6_admin').hide();
}

/***************From CONTACT*********************/

function contact_action(status,name,tel)
{
    Sound.enable();
    Sound.play('',{replace:true});
    Sound.disable();
    error = '';

    if(status == 'accept')
    {
        new Effect.Fade($('handy_contact_content'),   { duration: 0.5, from: 1, to: 0  });
        new Effect.Appear($('handy_contact_input'),   { duration: 0.5, from: 0, to: 1  });
    }
    else if(status == 'dismiss' || status == 'send')
    {
        if(status == 'send')
        {
            if($('contact_input_name').value == '' || $('contact_input_name').value == 'Name')
            {
                $('contact_input_name').style.color = 'red';
                error = 'name';
            }

            if($('contact_input_tel').value == '' || $('contact_input_tel').value == 'Telefonnummer')
            {
                $('contact_input_tel').style.color = 'red';
                error = 'tel';
            }
            
            if(error == '')
            {
                new Effect.Fade($('handy_contact_input'),   { duration: 0.5, from: 1, to: 0  });
                new Effect.Appear($('handy_contact_done'),   { duration: 0.5, from: 0, to: 1  });
                send_mail(name,tel);
            }
        }
        else
        {
            if($('handy_contact_content').style.display == '') new Effect.Fade($('handy_contact_content'),   { duration: 0.5, from: 1, to: 0  });
            if($('handy_contact_input').style.display == '') new Effect.Fade($('handy_contact_input'),   { duration: 0.5, from: 1, to: 0  });
            new Effect.Appear($('handy_contact_after'),   { duration: 0.5, from: 0, to: 1  });
        }
    }
}

function send_mail(name,tel)
{
   new Ajax.Request('page/send_mail.php?name=' + name + '&tel=' + tel,
   {
      method: 'get',
      onFailure: function(){ alert('Something went wrong...:' + page)},
        onSuccess: function(transport)
       {

       }
   });
}

function contact_leave()
{
    $('handy_contact_content').hide();
    $('handy_contact_input').hide();
    $('handy_contact_after').hide();
}


function contact_to_home()
{
    $('click_block').style.zIndex = '900';
    
    new Effect.Fade($('contact_content'),   { duration: 0.5, from: 1, to: 0  });
    new Effect.Move($('handy_contact'),         { x: 1300, y: 392, mode: 'absolute',duration: 1.0});
    $('ipad_link').hide();
    new Effect.Parallel([
        new Effect.Move($('banners1'),     { x: 860, y: 15, mode: 'absolute',duration: 1.0}),
        new Effect.Move($('ipad'),         { x: 280, y: 175, mode: 'absolute',duration: 1.0}),
        new Effect.Fade($('content_container_wonky'),   { duration: 0.5, from: 1, to: 0  }),
        new Effect.Appear($('content_container_normal'), { duration: 0.5, from: 0, to: 1  }),
        new Effect.Move($('notebook'),   { x: 1007, y: 490, mode: 'absolute',duration: 1.0}),
        new Effect.Fade($('notebook_inaktiv'),   { duration: 0.5, from: 1, to: 0  }),
        new Effect.Appear($('notebook_normal'), { duration: 0.5, from: 0, to: 1  }),
        new Effect.Appear($('handy_home'), { duration: 0.5, from: 0, to: 1  }),
        new Effect.Fade($('handy_down'),   { duration: 0.5, from: 1, to: 0  }),
        new Effect.Move($('handy'),        { x: 660, y: 520, mode: 'absolute',duration: 1.0}),
        new Effect.Move($('keychain_2'),   { x: -600, y: 135, mode: 'absolute',duration: 0.5})
        
        ], {afterFinish: function(){
                $('handy_home').show();
                $('click_block').style.zIndex = '-1';
                new Effect.Appear($('home'), { duration: 0.5, from: 0, to: 1  });
                new Effect.Move($('keychain_1'),   { x: -305, y: 435, mode: 'absolute',duration: 0.8,delay: 0.2});
                $('cards').hide();
                $('notebook_posts').show();
                contact_leave();
              }
           }
    );
    $('navi_home').id = 'navi_home_active';
    $('navi_contact_active').id = 'navi_contact';
    current = 'home';
}

function contact_to_about()
{
    $('click_block').style.zIndex = '900';
    new Effect.Fade($('contact_content'),   { duration: 0.5, from: 1, to: 0  });
    new Effect.Move($('handy_contact'),         { x: 1300, y: 392, mode: 'absolute',duration: 1.0});
    new Effect.Move($('keychain_2'),   { x: -600, y: 135, mode: 'absolute',duration: 0.8,delay: 0.2});
    $('ipad_link').hide();    
    new Effect.Parallel([
        new Effect.Move($('banners1'),     { x: 890, y: -90, mode: 'absolute',duration: 1.0}),
        new Effect.Move($('keychain_1'),   { x: -355, y: 435, mode: 'absolute',duration: 0.8,delay: 0.2}),
        new Effect.Move($('ipad'),         { x: 230, y: 175, mode: 'absolute',duration: 1.0}),
        new Effect.Fade($('content_container_wonky'),   { duration: 0.5, from: 1, to: 0  }),
        new Effect.Appear($('content_container_normal'), { duration: 0.5, from: 0, to: 1  }),
        new Effect.Move($('notebook'),   { x: 1007, y: 720, mode: 'absolute',duration: 1.0}),
        new Effect.Fade($('notebook_normal'),   { duration: 0.5, from: 1, to: 0  }),
        new Effect.Appear($('notebook_inaktiv'), { duration: 0.5, from: 0, to: 1  }),
        new Effect.Fade($('handy_home'),   { duration: 0.5, from: 1, to: 0  }),
        new Effect.Appear($('handy_down'), { duration: 0.5, from: 0, to: 1  }),
        new Effect.Appear($('about_side'), { duration: 0.5, from: 0, to: 1  }),
        new Effect.Move($('handy'),        { x: 660, y: 780, mode: 'absolute',duration: 1.0})
        ], {afterFinish: function(){
                $('ipad_title').show();
                new Effect.Parallel([
                    new Effect.Move($('topbar'), { x: -1, y: 0, mode: 'absolute',duration: 1.0}),
                    new Effect.Move($('bottombar'), { x: -2, y: 386, mode: 'absolute',duration: 1.0})
                    ], {afterFinish: function(){
                        new Effect.Appear($('about'), { duration: 0.5, from: 0, to: 1  });
                        $('click_block').style.zIndex = '-1';
                        $('cards').hide();
                        contact_leave();
                        }
                    }
                );
              }
           }
    );
    $('navi_about').id = 'navi_about_active';
    $('navi_contact_active').id = 'navi_contact';
    current = 'about';
}

function contact_to_work()
{
    $('click_block').style.zIndex = '900';
    new Effect.Fade($('contact_content'),   { duration: 0.5, from: 1, to: 0  });
    new Effect.Appear($('navi_ref'), { duration: 0.5, from: 0, to: 1  }),
    new Effect.Move($('handy_contact'),         { x: 1300, y: 392, mode: 'absolute',duration: 1.0});
    new Effect.Move($('keychain_2'),   { x: -600, y: 135, mode: 'absolute',duration: 0.8,delay: 0.2});
    new Effect.Parallel([
        new Effect.Move($('keychain_1'), { x: -305, y: 435, mode: 'absolute',duration: 0.2,delay: 0.8}),
        new Effect.Fade($('banners_normal'),   { duration: 0.5, from: 1, to: 0  }),
        new Effect.Appear($('banners_work'), { duration: 0.5, from: 0, to: 1  }),
        new Effect.Move($('banners1'),   { x: 690, y: 335, mode: 'absolute',duration: 1.0}),
        new Effect.Move($('banners2'),   { x: 630, y: 205, mode: 'absolute',duration: 1.0}),
        new Effect.Appear($('work_brands'), { duration: 0.5, from: 0, to: 1  }),
        new Effect.Move($('ipad'),       { x: 150, y: 850, mode: 'absolute',duration: 1.0}),
        new Effect.Move($('handy'),        { x: 660, y: 780, mode: 'absolute',duration: 1.0})
        ], {afterFinish: function(){
                    $('click_block').style.zIndex = '-1';
                    $('cards').hide();
                    contact_leave();
              }
           }
    );
    $('navi_work').id = 'navi_work_active';
    $('navi_contact_active').id = 'navi_contact';
    current = 'work';
}

function contact_to_jobs(text)
{
    $('click_block').style.zIndex = '900';
    new Effect.Fade($('contact_content'),   { duration: 0.5, from: 1, to: 0  });
    new Effect.Move($('handy_contact'),         { x: 1300, y: 392, mode: 'absolute',duration: 1.0});
    new Effect.Move($('keychain_2'),   { x: -600, y: 135, mode: 'absolute',duration: 0.8,delay: 0.2});
    $('ipad_link').hide();
    new Effect.Parallel([
        new Effect.Move($('banners1'),     { x: 890, y: -90, mode: 'absolute',duration: 1.0}),
        new Effect.Move($('keychain_1'),   { x: -305, y: 435, mode: 'absolute',duration: 0.8,delay: 0.2}),
        new Effect.Move($('ipad'),         { x: 280, y: 175, mode: 'absolute',duration: 1.0}),
        new Effect.Fade($('content_container_wonky'),   { duration: 0.5, from: 1, to: 0  }),
        new Effect.Appear($('content_container_normal'), { duration: 0.5, from: 0, to: 1  }),
        new Effect.Move($('handy'),        { x: 660, y: 780, mode: 'absolute',duration: 1.0})
        ], {afterFinish: function(){
                $('handy_down').show();
                $('click_block').style.zIndex = '-1';
                new Effect.Move($('topbar'), { x: -1, y: 0, mode: 'absolute',duration: 1.0});
                $('cards').hide();
                contact_leave();
                new Effect.Appear($(text),   { duration: 0.5, from: 0, to: 1, delay: 0.5  });
                if(text == 'jobs') $('ipad_title').innerHTML = 'Jobs';
                else if(text == 'imprint') $('ipad_title').innerHTML = 'Impressum';
              }
           }
    );
    $('navi_contact_active').id = 'navi_contact';
    $('navi_' + text + '_notebook').id = 'navi_' + text + '_notebook_active';
    if(text == 'jobs') $('navi_jobs').id = 'navi_jobs_active';
    current = text;
}

/***************From JOBS*********************/

function jobs_to_home()
{
    $('click_block').style.zIndex = '900';
    if($(current + '_admin')) $(current + '_admin').hide();
    new Effect.Move($('topbar'), { x: -1, y: -33, mode: 'absolute',duration: 1.0});
    new Effect.Parallel([
        new Effect.Move($('banners1'),     { x: 860, y: 15, mode: 'absolute',duration: 1.0}),
        new Effect.Move($('keychain_1'),   { x: -305, y: 435, mode: 'absolute',duration: 0.8,delay: 0.2}),
        new Effect.Move($('notebook'),   { x: 1007, y: 490, mode: 'absolute',duration: 1.0}),
        new Effect.Fade($('notebook_inaktiv'),   { duration: 0.5, from: 1, to: 0  }),
        new Effect.Appear($('notebook_normal'), { duration: 0.5, from: 0, to: 1  }),
        new Effect.Appear($('handy_home'), { duration: 0.5, from: 0, to: 1  }),
        new Effect.Fade($('handy_down'),   { duration: 0.5, from: 1, to: 0  }),
        new Effect.Move($('handy'),        { x: 660, y: 520, mode: 'absolute',duration: 1.0}),
        new Effect.Fade($('jobs'),   { duration: 0.5, from: 1, to: 0  })
        ], {afterFinish: function(){
                $('handy_home').show();
                $('click_block').style.zIndex = '-1';
                new Effect.Appear($('home'),   { duration: 0.5, from: 0, to: 1, delay: 0.5  })
                $('ipad_title').innerHTML = 'About';
                $('notebook_posts').show();
              }
           }
    );
    
    $('navi_home').id = 'navi_home_active';
    $('navi_' + current + '_notebook_active').id = 'navi_' + current + '_notebook';
    if(current == 'jobs') $('navi_jobs_active').id = 'navi_jobs';
    $(current).hide();
    current = 'home';
}

function jobs_to_about()
{
    $('click_block').style.zIndex = '900';
    if($(current + '_admin')) $(current + '_admin').hide();
    new Effect.Parallel([
        new Effect.Move($('banners1'),     { x: 890, y: -90, mode: 'absolute',duration: 1.0}),
        new Effect.Move($('keychain_1'),   { x: -355, y: 435, mode: 'absolute',duration: 0.8,delay: 0.2}),
        new Effect.Fade($('jobs'),   { duration: 0.5, from: 1, to: 0  }),
        new Effect.Appear($('about_side'), { duration: 0.5, from: 0, to: 1  }),
        new Effect.Move($('ipad'),         { x: 230, y: 175, mode: 'absolute',duration: 1.0})
           ], {afterFinish: function(){
                $('ipad_title').innerHTML = 'About';
                new Effect.Parallel([
                    new Effect.Move($('topbar'), { x: -1, y: 0, mode: 'absolute',duration: 1.0}),
                    new Effect.Move($('bottombar'), { x: -2, y: 386, mode: 'absolute',duration: 1.0})
                    ], {afterFinish: function(){
                        new Effect.Appear($('about'), { duration: 0.5, from: 0, to: 1  });
                        $('click_block').style.zIndex = '-1';
                        }
                    }
                );
              }
           }
    );
    
    $('navi_about').id = 'navi_about_active';
    $('navi_' + current + '_notebook_active').id = 'navi_' + current + '_notebook';
    if(current == 'jobs') $('navi_jobs_active').id = 'navi_jobs';
    $(current).hide();
    current = 'about';
}

function jobs_to_work()
{
    $('click_block').style.zIndex = '900';
    if($(current + '_admin')) $(current + '_admin').hide();
    new Effect.Parallel([
        new Effect.Move($('ipad'),         { x: 150, y: 850, mode: 'absolute',duration: 1.0}),
        new Effect.Appear($('navi_ref'), { duration: 0.5, from: 0, to: 1  }),
        new Effect.Fade($('banners_normal'),   { duration: 0.5, from: 1, to: 0  }),
        new Effect.Appear($('banners_work'), { duration: 0.5, from: 0, to: 1  }),
        new Effect.Move($('banners1'),   { x: 690, y: 335, mode: 'absolute',duration: 1.0}),
        new Effect.Move($('banners2'),   { x: 630, y: 205, mode: 'absolute',duration: 1.0}),
        new Effect.Appear($('work_brands'), { duration: 0.5, from: 0, to: 1  }),
        new Effect.Fade($('content_container_normal'),   { duration: 0.5, from: 1, to: 0  }),
        new Effect.Appear($('content_container_wonky'), { duration: 0.5, from: 0, to: 1  }),
        new Effect.Fade($('jobs'), { duration: 0.5, from: 1, to: 0  })
        ], {afterFinish: function(){
                    $('click_block').style.zIndex = '-1';
                    $('ipad_link').show();
                    new Effect.Move($('topbar'),   { x: -1, y: -33, mode: 'absolute',duration: 1.0});
              }
           }
    );
    $('navi_work').id = 'navi_work_active';
    $('navi_' + current + '_notebook_active').id = 'navi_' + current + '_notebook';
    if(current == 'jobs') $('navi_jobs_active').id = 'navi_jobs';
    $(current).hide();
    current = 'work';
    $('ipad_title').innerHTML = 'About';
}

function jobs_to_contact()
{
    $('click_block').style.zIndex = '900';
    if($(current + '_admin')) $(current + '_admin').hide();
    new Effect.Parallel
    ([
        new Effect.Move($('banners1'),   { x: 890, y: -90, mode: 'absolute',duration: 1.0}),
        new Effect.Move($('keychain_1'),   { x: -600, y: 435, mode: 'absolute',duration: 0.8,delay: 0.2}),
        new Effect.Move($('ipad'),         { x: 150, y: 780, mode: 'absolute',duration: 1.0}),
        new Effect.Fade($('content_container_normal'),   { duration: 0.5, from: 1, to: 0  }),
        new Effect.Appear($('content_container_wonky'), { duration: 0.5, from: 0, to: 1  }),
        new Effect.Move($('handy'),        { x: 660, y: 1000, mode: 'absolute',duration: 1.0}),
        new Effect.Fade($('jobs'), { duration: 0.5, from: 1, to: 0  })
        ], {afterFinish: function(){
                $('handy_down').show();
                $('click_block').style.zIndex = '-1';
                $('ipad_link').show();
                new Effect.Move($('handy_contact'),        { x: 760, y: 392, mode: 'absolute',duration: 1.0});
                new Effect.Move($('keychain_2'),   { x: 0, y: 135, mode: 'absolute',duration: 0.5});
                new Effect.Appear($('cards'),   { duration: 0.5, from: 0, to: 1, delay: 0.5  });
                new Effect.Appear($('contact_content'),   { duration: 0.5, from: 0, to: 1, delay: 0.5  });
                new Effect.Move($('topbar'),   { x: -1, y: -33, mode: 'absolute',duration: 1.0});
                new Effect.Appear($('handy_contact_content'),   { duration: 1.0, from: 0, to: 1, delay: 3.0, 
                  afterFinish: function(){
                    if(current == 'contact')
                    {
                        Sound.enable();
                        Sound.play('audio/ringtone.mp3',{replace:true});
                        setTimeout("Sound.play('audio/ringtone.mp3',{replace:true});",3000);
                        setTimeout("Sound.play('audio/ringtone.mp3',{replace:true});",6000);
                        setTimeout("Sound.play('audio/ringtone.mp3',{replace:true});",9000);
                    }
                  }
                
                });
              }
           }
    );
    $('navi_contact').id = 'navi_contact_active';
    $('navi_' + current + '_notebook_active').id = 'navi_' + current + '_notebook';
    if(current == 'jobs') $('navi_jobs_active').id = 'navi_jobs';
    $(current).hide();
    current = 'contact';
}

function jobs_to_jobs()
{
    if(current == 'jobs')
    {
        new Effect.Fade($('jobs'),   { duration: 0.5, from: 1, to: 0  });
        new Effect.Appear($('imprint'), { duration: 0.5, from: 0, to: 1  });
        $('ipad_title').innerHTML = 'Impressum';
        $('navi_imprint_notebook').id = 'navi_imprint_notebook_active';
        $('navi_jobs_active').id = 'navi_jobs';
        $('navi_jobs_notebook_active').id = 'navi_jobs_notebook';
        if($(current + '_admin')) $(current + '_admin').hide();
        current = 'imprint';
    }
    else if(current == 'imprint')
    {
        new Effect.Fade($('imprint'),   { duration: 0.5, from: 1, to: 0  });
        new Effect.Appear($('jobs'), { duration: 0.5, from: 0, to: 1  });
        $('ipad_title').innerHTML = 'Jobs';
        $('navi_imprint_notebook_active').id = 'navi_imprint_notebook';
        $('navi_jobs_notebook').id = 'navi_jobs_notebook_active';
        $('navi_jobs').id = 'navi_jobs_active';
        if($(current + '_admin')) $(current + '_admin').hide();
        current = 'jobs';
    }
}

function rolloBottomOver() {
	$('about_team_side').style.backgroundPosition = "bottom";
}

function rolloTopOver() {
	$('about_team_side').style.backgroundPosition = "center";
}

function rolloOut() {
	$('about_team_side').style.backgroundPosition = "top";
}
