var glider;
var aktiv;
var pos;
var stage = 0;
var gt;

function getWinHeight() {
	var winHt = 0;
	if (window.innerHeight) winHt = window.innerHeight-18;
	else if (document.documentElement &&
document.documentElement.clientHeight) 
		winHt = document.documentElement.clientHeight;
	else if (document.body && document.body.clientHeight) 
		winHt = document.body.clientHeight;
	return winHt;
}

function gliderInit() {
	glider = document.getElementById('top_glider');
	aktiv = window.setInterval("doTimeout()", 20);
	pos = getWinHeight()-50;
	gt = new Date().getTime();
}

function doTimeout() {
	var dur = new Date().getTime() - gt;
	glider.height = (pos-300)+(Math.sin((dur/100))+2)*20*(1-(dur/5000))+29;
	if (dur > 5000)
		window.clearInterval(aktiv);
}




$(document).ready(function() {
	$('.csc-textpic-image').mouseover(function() {
		if ($('img',this).attr('longdesc')) {
			$('.mouseover',this).html($('img',this).attr('longdesc'));
			$('.mouseover',this).show();
			if ($('a',this).attr('href') != undefined) {
				$('body').css('cursor', 'pointer');
				$(this).click(function() {
					window.location.href = $('a',this).attr('href');
				});
			}
		}
	});
	$('.csc-textpic-image').mouseout(function() {
		$('body').css('cursor', 'default');
		$('.mouseover',this).html('');
		$('.mouseover',this).hide();
	});
});

