jQuery().ready(function(){
	// init mainnavigation for IE
	if (!!(window.attachEvent && !window.opera) && (typeof window.XMLHttpRequest == "undefined")) {
		$('ul#mainnav>li').hover(
			function() { $('ul', this).css('display', 'block'); },
			function() { $('ul', this).css('display', 'none'); }
		);
	}
	
	// style back link
	$('.back-arrow a:first').addClass('back-pic');
	
	// css fix for first element of mainnavigation
	$("#mainnav li.firstlevel:last").css("margin-left","-1px");
	$('#mainnav li ul:first').css('margin-left','4px');
	
	// remove last pipe in metanavigation
	$('#meta ul li:last-child').addClass('last');
	
	// remove last breadcrumb arrow
	$('#breadcrumb span.bread-arrow:last').hide();
	
	var c = 0;
	$("#acc-list a").each(function(){	
		var firsthtml = $(this).html();
		if(c==0){
			$(this).html('<span class="acc-special">'+firsthtml+'</span>');
		} else {
			$(this).html('<span class="acc-regular">'+firsthtml+'</span>');
		}
		c++;
	});
	
    if( $("#acc-list a:first").hasClass("linked") ){
		
		$("#acc-list a.linked:not(:first)").each(function(){
			$(this).removeClass("linked");
			$(this).addClass("acc-reg");
		});
		$("#acc-list a:first").removeClass("linked");
		$("#acc-list a:first").addClass("acc-first");
		

	} else {
		// style accordion
		$('#acc-list a.acc-first:not(:first)').addClass('acc-reg');
		$('#acc-list a.acc-first:not(:first)').removeClass('acc-first');
		
		$('#acc-list').accordion({
			header: '.acc-first,.acc-reg',
	        active: 0,
	        animated: 'easeslide'
	    });
	}
	

	// modify teaser boxes - append the more-link to teasertext
	$('.teasertext').each(function(){
		$(this).find('p').append($(this).find('a:last'));
		$(this).find('a:last').css('margin-left','8px');
	});
	
//	$(".basic a:first").css('background','transparent url(fileadmin/templates/v2/img/acc_top_arrow.gif) repeat-x scroll 0 0');
	
//	$(".basic a:first").hasClass("selected").css('background','transparent url(fileadmin/templates/v2/img/acc_top_arrow_act.gif) repeat-x scroll 0 0');

	/*$(".basic a:first").css("background","transparent url(/fileadmin/templates/v2/img/acc_top_arrow.gif) repeat-x scroll 0 0");
	$(".basic a:first").mouseover(function(){
		$(this).css("background","transparent url(/fileadmin/templates/v2/img/acc_top_arrow_act.gif) repeat-x scroll 0 0");
	}).mouseout(function(){
		$(this).css("background","transparent url(/fileadmin/templates/v2/img/acc_top_arrow.gif) repeat-x scroll 0 0");
	});
	$(".basic a:first.selected").css("background","transparent url(/fileadmin/templates/v2/img/acc_top_arrow_act.gif) repeat-x scroll 0 0").mouseover(function(){
		$(this).css("background","transparent url(/fileadmin/templates/v2/img/acc_top_arrow_act.gif) repeat-x scroll 0 0")
	}).mouseout(function(){
		$(this).css("background","transparent url(/fileadmin/templates/v2/img/acc_top_arrow_act.gif) repeat-x scroll 0 0")
	});
	
	$(".basic a:not(:first)").each(function(){
		$(this).css("background","transparent url(/fileadmin/templates/v2/img/acc_headline_arrow.gif) repeat-x scroll 0 0");
	}).mouseover(function(){
		$(this).css("background","transparent url(/fileadmin/templates/v2/img/acc_headline_arrow_act.gif) repeat-x scroll 0 0");
	}).mouseout(function(){
		$(this).css("background","transparent url(/fileadmin/templates/v2/img/acc_headline_arrow.gif) repeat-x scroll 0 0");
	});*/

// basic a first notFirst
//background:transparent url(../img/acc_headline_arrow.gif) repeat-x scroll 0 0;
//background:transparent url(../img/acc_headline_arrow_act.gif) repeat-x scroll 0 0;


	
});
