// <![CDATA[

var onFirstPage = true;

function resizeFlash( height, didOnce )
{
    var o = $( '#c1 object' );
    var e = $( '#c1 embed' );
    
    if( o )
    {
        o.height( height );
    }
    
    if( e )
    {
        e.height( height );
    }
    
    //alert( height );
}

function exitFirstPage()
{
    var i = $( '#header .left img' );
    
    if( i )
    {
        i.attr( 'src', '/fileadmin/templates/chuv/css/pictures/logo-text.png' );
    }
    
    $( '#impressum' ).slideUp( 'slow' );
    
    onFirstPage = false;
}

function confirmQuitQuizz( text )
{
    if( onFirstPage == true )
    {
        return true;
    }
    
    if( !confirm( text ) )
    {
        return false;
    }
    
    return true;
}

function addShareThisButtons()
{
    var shared_object = SHARETHIS.addEntry
    (
        {
            title:  document.title,
            url:    document.location.href
        }
    );
    
    shared_object.attachButton( document.getElementById( 'ck_sharethis' ) );
    shared_object.attachChicklet( 'email', document.getElementById( 'ck_email' ) );
    shared_object.attachChicklet( 'facebook', document.getElementById( 'ck_facebook' ) );
    shared_object.attachChicklet( 'twitter', document.getElementById( 'ck_twitter' ) );
}

function flexLoaded()
{
    addShareThisButtons();
}

// ]]>

