function dgebi(dgebiID) {
    return document.getElementById(dgebiID);
}

function channelOverview() {
    if(dgebi('channels').className == 'channelsHide') {
	if( dgebi('biotrailers').className == 'splittrailersShow' ) {
		biotrailersOverview();
	} else if( dgebi('dvdtrailers').className == 'splittrailersShow' ) {
		dvdtrailersOverview();
	}
        $("#channels").addClass("channelsShow").show("slow");
        $("#channels").removeClass("channelsHide");
    } else {
        $("#channels").addClass("channelsHide").hide("slow");
        setTimeout('$("#channels").removeClass("channelsShow")',1500);
    }
}

function showChannels(sprog) {
    document.getElementById('channelsDE').style.display='none';
    document.getElementById('channelsDK').style.display='none';
    document.getElementById('channelsSE').style.display='none';
    document.getElementById('channelsNO').style.display='none';
    document.getElementById('channelsUK').style.display='none';
    document.getElementById('channelsDEanchor').className='channelsFane';
    document.getElementById('channelsDKanchor').className='channelsFane';
    document.getElementById('channelsSEanchor').className='channelsFane';
    document.getElementById('channelsNOanchor').className='channelsFane';
    document.getElementById('channelsUKanchor').className='channelsFane';
    
    document.getElementById('channels'+sprog).style.display='block';
    document.getElementById('channels'+sprog+'anchor').className='channelsFane_selected';
}

function biotrailersOverview() {
    if(dgebi('biotrailers').className == 'trailersHide') {
	if(dgebi('channels').className == 'channelsShow') {
		channelOverview();
	} else if( dgebi('dvdtrailers').className == 'splittrailersShow' ) {
		dvdtrailersOverview();
	}
        $("#biotrailers").addClass("splittrailersShow").show("slow");
        $("#biotrailers").removeClass("trailersHide");
    } else {
        $("#biotrailers").addClass("trailersHide").hide("slow");
        setTimeout('$("#biotrailers").removeClass("splittrailersShow")',1500);
    }
}

function dvdtrailersOverview() {
    if(dgebi('dvdtrailers').className == 'trailersHide') {
	if(dgebi('channels').className == 'channelsShow') {
		channelOverview();
	} else if( dgebi('biotrailers').className == 'splittrailersShow' ) {
		biotrailersOverview();
	}
        $("#dvdtrailers").addClass("splittrailersShow").show("slow");
        $("#dvdtrailers").removeClass("trailersHide");
    } else {
        $("#dvdtrailers").addClass("trailersHide").hide("slow");
        setTimeout('$("#dvdtrailers").removeClass("splittrailersShow")',1500);
    }
}

function showMidtTrailers(medie) {
    document.getElementById('trailersMidtBio').style.display='none';
    document.getElementById('trailersMidtDVD').style.display='none';
    document.getElementById('trailersMidtBioanchor').className='trailersFane';
    document.getElementById('trailersMidtDVDanchor').className='trailersFane';
    
    document.getElementById('trailersMidt'+medie).style.display='block';
    document.getElementById('trailersMidt'+medie+'anchor').className='trailersFane_selected';
}
