$(document).ready(function(){

	$('table.compare td, table.compare-2 td').each(function(){
		if($(this).html()=='Ja') {
			$(this).html('<img src="/fileadmin/img/icons/accept.png" alt="Ja" width="16" height="16" />');
		}
	});
	$('acronym').tooltip({
    	showURL: true
	});
	$('ul.subnavi>li:not(.active)>a').each(function(){
		$(this).mouseover(function(){
			if(!$(this).is(':animated')) {
				$(this).animate({paddingLeft: 20}, 'fast');
			}
		});
		$(this).mouseout(function(){
			$(this).animate({paddingLeft: 10}, 'fast');
		});
	});
	$('#OrderList').accordion({
		header: 'a.listhead',
  		autoHeight: false,
  		active: '.active'
	});
	$('#OrderList').accordion('activate', 0);
	$('#OrderList').accordion('disable');

	var newscounter=($('div.newslisting div.newsitem').length)-1;
	showNewsItem(0, newscounter);
	$('#newsLeftArrow').hide();

	$(document).pngFix();
});

function showNewsItem(i, newscounter) {
	$('div.newslisting div.newsitem').each(function() {
		$(this).hide();
	});

	$('div.newslisting div.newsitem:eq('+i+')').fadeIn();
	var next=((i+1)<=newscounter) ? (i+1) : 0;

	window.setTimeout('showNewsItem('+next+', '+newscounter+')', 15000);
}

function enterPressed(e) {
	var keycode;
	if (window.event) keycode = window.event.keyCode;
	else if (e) keycode = e.which;
	else return false;
	return (keycode == 13);
}

function getRandom(min, max) {
	if( min > max ) {
		return( -1 );
	}
	if( min == max ) {
		return( min );
	}
	var r = parseInt( Math.random() * ( max+1 ) );
	return( r + min <= max ? r + min : r );
}


