var CountdownJahr = 2010;
var CountdownMonat = 10;
var CountdownTag = 6;
var CountdownStunde = 12;
var CountdownMinute = 0;
var CountdownSekunde = 0;

function CountdownAnzeigen()
{
    var Jetzt = new Date();
    var Countdown = new Date(CountdownJahr, CountdownMonat-1, CountdownTag, CountdownStunde, CountdownMinute, CountdownSekunde);
    var MillisekundenBisCountdown = Countdown.getTime()-Jetzt.getTime();
    var Rest = Math.floor(MillisekundenBisCountdown/1000);
    var CountdownText = "";

    if(Rest >= 31536000)
    {
        var Jahre = Math.floor(Rest/31536000);
        Rest = Rest-Jahre*31536000;

        if(Jahre > 1 || Jahre == 0)
        {
            CountdownText += Jahre + " Jahre ";
        }
        else if(Jahre == 1)
        {
            CountdownText += Jahre + " Jahr ";
        }
    }
    if(Rest >= 86400)
    {
        var Tage = Math.floor(Rest/86400);
        Rest = Rest-Tage*86400;

        if(Tage > 1 || Tage == 0)
        {
            CountdownText += Tage + " Tage ";
        }
        else if(Tage == 1)
        {
            CountdownText += Tage + " Tag ";
        }
    }
    if(Rest >= 3600)
    {
        var Stunden = Math.floor(Rest/3600);
        Rest = Rest-Stunden*3600;

        if(Stunden > 1 || Stunden == 0)
        {
            CountdownText += Stunden + " Stunden ";
        }
        else if(Stunden == 1)
        {
            CountdownText += Stunden + " Stunde ";
        }
    }
    if(Rest >= 60)
    {
        var Minuten = Math.floor(Rest/60);
        Rest = Rest-Minuten*60;

        if(Minuten > 1 || Minuten == 0)
        {
            CountdownText += Minuten + " Minuten ";
        }
        else if(Minuten == 1)
        {
            CountdownText += Minuten + " Minute ";
        }
    }

    if(Rest > 1 || Rest == 0)
    {
        CountdownText += Rest + " Sekunden ";
    }
    else if(Rest==1)
    {
        CountdownText += Rest + " Sekunde ";
    }

    if(Rest < 0){
	window.location = '?counter';
    }

    document.getElementById('Countdown').innerHTML = CountdownText;
    window.setTimeout("CountdownAnzeigen()", 1000);
}

function show_bm_menu(oc)
{
	if(oc == 0){
		menu_big.style.visibility='hidden';
		menu_mini.style.visibility='visible';
	}else{
		menu_big.style.visibility='visible';
		menu_mini.style.visibility='hidden';
	}
}

function screen_wxh(){
	return (screen.width+"x"+screen.height);
}

function linktypadd(qs,typ)
{
	
	location.href = "index.php?p=menu&add"+qs+"&ltype="+typ;
}

function wpic(element)
{
	if(document.getElementById(element).style.visibility == 'hidden'){
		document.getElementById(element).style.visibility = 'visible';
	}else{
		document.getElementById(element).style.visibility = 'hidden';
	}
}

function showkat (id, subids){
	var a = subids.split("-");

	if(isNaN(document.getElementById("sub"+id))){
	mu = eval("sub"+id);
		if(mu.style.visibility == 'hidden'){
			mu.style.height = '';
			mu.style.overflow = '';
			mu.style.visibility = 'visible';
		}else{
			mu.style.height = '0px';
			mu.style.overflow = 'hidden';
			mu.style.visibility = 'hidden';
		}
	}

	for (var i = 0; i < a.length; ++i){
		if(isNaN(document.getElementById("sub"+a[i]))){
		mu = eval("sub"+a[i]);
			mu.style.height = '0px';
			mu.style.overflow = 'hidden';
			mu.style.visibility = 'hidden';
		}
	}
}

function showsub (id, subids){
	var a = subids.split("-");

	if(isNaN(document.getElementById("sub"+id))){
	mu = eval("sub"+id);
		if(mu.style.visibility == 'hidden'){
			mu.style.height = '';
			mu.style.overflow = '';
			mu.style.visibility = 'visible';
		}else{
			mu.style.height = '0px';
			mu.style.overflow = 'hidden';
			mu.style.visibility = 'hidden';
		}
	}

	for (var i = 0; i < a.length; ++i){
		if(a[i] != id){
			if(isNaN(document.getElementById("sub"+a[i]))){
				mu = eval("sub"+a[i]);
					mu.style.height = '0px';
					mu.style.overflow = 'hidden';
					mu.style.visibility = 'hidden';
			}
		}
	}
}

function shupform (id){
	if(isNaN(document.getElementById(id))){
	mu = eval(id);
		if(mu.style.visibility == 'hidden'){
			mu.style.height = '';
			mu.style.overflow = '';
			mu.style.visibility = 'visible';
		}else{
			if(isNaN(document.getElementById(id))){
			mu = eval(id);
				mu.style.height = '0px';
				mu.style.overflow = 'hidden';
				mu.style.visibility = 'hidden';
			}
		}
	}
}

$(document).ready(function(){
	$("a[rel='screens']").colorbox({
		title: function(){
			var url = $(this).attr('href');
			return '<a href="'+url+'" target="_blank"><span style="color: #fff; ">Fullscreen</span></a>';
		},
		opacity:0.7,
		maxHeight:'90%',
		maxWidth:'90%',
		current: 'Screenshots {current} von {total}'
	});

	$("a[rel='grabscreens']").colorbox({
		title: function(){
			var url = $(this).attr('href');
			return '<a href="'+url+'" target="_blank"><span style="color: #fff; ">Fullscreen</span></a>';
		},
		opacity:0.7,
		maxHeight:'90%',
		maxWidth:'90%',
		current: 'Screenshots {current} von {total}'
	});

	$("a[rel='galscreens']").colorbox({
		title: function(){
			var url = $(this).attr('href');
			var title = $(this).attr('title');
			if(title != ''){
				title = " - " + title;
			}
			return '<a href="'+url+'" target="_blank"><span style="color: #fff; ">Fullscreen</span></a>' + title;
		},
		opacity:0.7,
		height:'600px',
		width:'800px',
		current: 'Screenshots {current} von {total}'
	});

	$("a[rel='tempelscreen']").colorbox({
		title: function(){
			var url = $(this).attr('href');
			return '<a href="'+url+'&org" target="_blank"><span style="color: #fff; ">Fullscreen</span></a>';
		},
		opacity:0.7,
		maxHeight:'90%',
		maxWidth:'90%',
		current: 'Screenshots {current} von {total}'
	});

	$("a[rel='example5']").colorbox({
		opacity:0.7,
		maxHeight:'90%',
		maxWidth:'90%'
	});
});

