jQuery.noConflict();

jQuery(document).ready(function(){
	
	// not in IE6
	if (!(jQuery.browser.msie && jQuery.browser.version < 7)) {
		/* Subnavigation styles */
		/*jQuery('#nav_sub li.active').prev().children('a').css('background-image', 'none');
		jQuery('#nav_sub li:not(.active)').hover(function(){
			jQuery(this).prev().children('a').css('background-image', 'none');
			jQuery(this).children('a').css('background-image', 'url(/fileadmin/img/shiny_buttons/sub_bg_current.gif)');
		},
		function(){
			//jQuery(this).prev().children('a').css('background-image', 'url(/fileadmin/img/bg_nav_li.gif)');
			//jQuery(this).prev().children('a').css('background-repeat', 'no-repeat');
			jQuery(this).prev().children('a').removeAttr('style');
			jQuery(this).children('a').removeAttr('style');
			//jQuery(this).css('background-image', 'none');
		});*/
	}
	
	/* Menu */
	jQuery("#nav_main a, #nav_sub a").click(function(){
		jQuery(this).removeAttr("onmouseout");
	});
	
	/* News */
	jQuery("#page_10 .news-list-item").each(function(i) {
		// news content is not empty
		if (jQuery(this).children(".news-list-content").text()) {
			jQuery(this).append('<div class="news-toggle">&nbsp;<a href="#">aufklappen</a></div>');
			jQuery(this).children('.news-list-content').hide();
		}
	});
	jQuery("#page_10 .news-toggle a, #page_10 .news-list-title").click(function(){
		toggleNews(jQuery(this).closest('.news-list-item'));
		return false;
	});
	
	/* Browselinks tt-news */
	jQuery(".tx-ttnews-browsebox a:first-child").addClass("first");
	jQuery(".tx-ttnews-browsebox a:last-child").addClass("last");
	
	/* Rechte Spalte Linien entfernen */
	jQuery(".tx-ttnews-browsebox a:first-child").css({"border-top":"0px"});
	
	/* Akkordion */
	jQuery(".rgaccord1-content").hide();
	// show first element on page "Karriere - Was wir bieten"
	jQuery("#page_139 #col1_content .rgaccord1-nest:first .rgaccord1-content").show();
	// show first element on page "Karriere - Wen wir suchen"
	jQuery("#page_138 #col1_content .rgaccord1-nest:first .rgaccord1-content").show();
	// show first element on page "Karriere - Auszeichnungen"
	jQuery("#page_155 #col1_content .rgaccord1-nest:first .rgaccord1-content").show();
	// show first element on page "Agentur - Systemhaus / Soziales Engagement"
	jQuery("#page_131 #col1_content .rgaccord1-nest:first .rgaccord1-content").show();
	// show first element on page "Magento"
	jQuery("#page_207 #col1_content .rgaccord1-nest:first .rgaccord1-content").show();
	
	jQuery(".rgaccord1-toggle").each(function(i) {
		if (jQuery(this).siblings('.rgaccord1-content').css('display') == 'block') {
			jQuery(this).append('<a href="#">zuklappen</a>');
			jQuery(this).toggleClass("rgaact");
		} else {
			jQuery(this).append('<a href="#">aufklappen</a>');
		}
	});
	
	jQuery(".rgaccord1-toggle").click(function(){
		jQuery(this).toggleClass("rgaact");
		if (jQuery(this).children('a').text() == 'aufklappen') {
			jQuery(this).children('a').text('zuklappen');
		} else {
			jQuery(this).children('a').text('aufklappen');
		}
		jQuery(this).next(".rgaccord1-content").toggle();
		return false;
	});
	
	/* Hover-Links */
	jQuery("#col3 .blog-marketing-meile .news-list-item,#col3 .blog-marketing-meile .news-latest-item,#col3 .blog-jung-und-willig .news-list-item,#col3 .blog-jung-und-willig .news-latest-item,#col3 .news_teaser .news-latest-item,#col3 .web20_teaser .csc-textpic,#col3 .certificates_teaser .csc-textpic").hover(
		function () {
			jQuery(this).addClass("highlight");
		},
		function () {
			jQuery(this).removeClass("highlight");
		}
	);
	
	/* Aufklappelemente Karriere */
	jQuery("#page_139 div.rgaccord1-nest:first-child .rgaccord1-content").css({"display":"block"});

	/* Aufklappelemente Magento */
	jQuery("#page_207 div.rgaccord1-nest:first-child .rgaccord1-content").css({"display":"block"});
	
	/* remove formular input on click */
	jQuery(".call_back_teaser input[type=text]").focus(function(){
		jQuery(this).attr('value', '');
	});
	
});

function toggleNews(item) {
	item.children('.news-toggle').toggleClass("act");
	if (item.find('.news-toggle a').text() == 'aufklappen') {
		item.find('.news-toggle a').text('zuklappen');
	} else {
		item.find('.news-toggle a').text('aufklappen');
	}
	item.children('.news-list-content').toggle();
}