Event.observe(window, 'load',initDSGA, false);


function initDSGA() {
    updateHeight();
    initThickbox();
}

function showFilmstripIE() {
    document.write('<object width="1000" height="102" data="flash/thumbnail.swf" type="application/x-shockwave-flash">');
    document.write('<param name="wmode" value="transparent" />');
    document.write('<param name="movie" value="flash/thumbnail.swf" />');
    document.write('</object>');
}

function updateHeight(){

        var maxHeight = 0;

        $('topmenu').descendants().each(function(element) {
          if(element.tagName == "DIV") {
          if (element.id != "") {
          if (element.id != "content"){
          divHeight = $(element.id).getHeight();
              if(divHeight > maxHeight)
                    maxHeight = divHeight;

           }
          }
        }
      });


    $('wrapper').scrollTo();
    new Effect.ResizeTo('wrapper', (maxHeight+335), {duration:0.5});
    }


function resetNavi () {
        $('content').hide();
        $('form_upload').hide();
        $('nav_upload').show();
        $('form_sendafriend').hide();
        $('nav_sendafriend').show();
        $('form_suchen').hide();
        $('nav_suchen').show();

}

function toggleNavi(showitem) {
    
        if ('upload' != showitem){
            new Effect.Appear('stoerer');
        } else {
            new Effect.Fade('stoerer');
        }
        
        resetNavi();

        $('nav_'+showitem).hide();
        $('form_'+showitem).show();
        $(showitem+'_container').hide();
        
        updateHeight();
        
        new Effect.Appear(showitem+'_container', {duration:0.8, startcolor:'#FFB600'});
        return false;
    }


function showContent(cid) {
        loadCmsContent('inner_content', cid);
        resetNavi();
       // $('content').show();
        return false;
    }

function show_upload(theid){
        new Effect.Fade(theid.parentNode, {duration:0.5,afterFinish:function(){toggleNavi('upload')}});
        return false;
    }
    
function go_upload(theid){
        new Effect.Fade(theid.parentNode, {duration:0.5,afterFinish:function(){location.href='video_hochladen,5.html'}});
        return false;
    }

function update_orte(target, src){
        var url = 'inc/ajax_update_orte.php';
        var pars = 'land='+escape($F(src));
        var myAjax = new Ajax.Updater(target, url, {    method: 'get',    parameters: pars});
        new Effect.Opacity(target, {duration:0.5, from:0, to:1});
    }
    


var sek = false;
function count(anfang){
    if(sek == false){sek = anfang;}
    sek++;
    var mins = parseInt(sek/60);
    var rest = sek - mins*60;

    if (mins < 10) {mins = "0" + mins;}
    if (rest < 10) {rest = "0" + rest;}

    document.getElementById('counter').innerHTML = mins + ":" + rest + "MIN";
    window.setTimeout('count()',1000);
}


