﻿$(document).ready(function() { 
	$('.mehr_bg').click(function() {
		
	  	$('#right-col').animate({
	    	marginLeft: -489
	  	}, 400);
	  	$('#footer').animate({
	    	width: 242
	  	}, 400);
	  	$('.mehr_bg').hide();
	  	$('.zurueck_bg').show();
	  	
	  	$("#federation").load('/index.php?id=192', function() {
			$("#federation").show();
			
			$(".more_fed").click(function () {
				$('.fed_plus2').hide();
				$('.fed_plus').show();		
		    });
		    
		    $(".more_fed2").click(function () {
		    	$('.fed_plus').hide();
				$('.fed_plus2').show();		
		    });
		    
		    $(".less_fed").click(function () {
				$('.fed_plus').hide();		
		    });
		    
		    $(".less_fed2").click(function () {
				$('.fed_plus2').hide();		
		    });
		    
			$(".fed-cell-co").mouseenter(function () {
				$(this).parent().find('.fed-cell-co').css('z-index', '65').show();
				$(this).parent().find('.fed-cell-back').css('z-index', '60').show();
		    });
		    
		    $(".fed-cell-co").mouseleave(function () {
				$(this).parent().find('.fed-cell-back').css('z-index', '50').hide();
				$(this).parent().find('.fed-cell-co').css('z-index', '40').show();
		    });
		});
		
	  	var tmpbg = $('body').attr('style');
	  	// alert(tmpbg);
	  	if (tmpbg != 'background: url("/fileadmin/user_upload/site_backgrounds/foederation_sw.jpg") repeat scroll left top rgb(255, 255, 255);') {
			$('body').attr('rel', tmpbg) ;
			$('body').attr('style','background: url("/fileadmin/user_upload/site_backgrounds/foederation_sw.jpg") repeat scroll 242px 0px rgb(255, 255, 255);');
		}
	});
	
	$('.zurueck_bg').click(function() {
		$("#federation").hide();
	  	$('#right-col').animate({
	    	marginLeft: 241
	  	}, 400);
	  	$('#footer').animate({
	    	width: 974
	  	}, 400);
	  	$('.zurueck_bg').hide();
	  	$('.mehr_bg').show();
	  	var tmpbg = $('body').attr('rel');
	  	if(tmpbg != '') {
			$('body').attr('rel', '') ;
			$('body').attr('style',tmpbg);
		}
	});
	
	
	$(".kopf-1-2").mouseenter(function () {
		$(this).children('.overlay').css('top', '0');		
    });
    $(".kopf-1-2 .overlay").mouseleave(function () {
		$(this).animate({top: '242'}, 1);	
    });
    
    $(".kopf-1-3").mouseenter(function () {
		$(this).children('.overlay').css('top', '0');		
    });
    $(".kopf-1-3 .overlay").mouseleave(function () {
		$(this).animate({top: '242'}, 1);	
    });
	
	/*
	$(".flash_1_1").mouseenter(function () {
		if ($('.flash_1_1 .p_overlay h2').size() == 0) {
			$(this).children('.p_overlay').append("<h2>Redaktion auf Recherche</h2><p>Regelmäßig melden sich die beiden Chefredakteure von fischerAppelt, relations, Harald Ehren und Mirjam Stegherr (Stv.) an dieser Stelle zu Wort. Mit ihrer „Flip“-Videokamera in der Hand recherchieren sie zu aktuellen Anlässen bei Kommunikationsverantwortlichen und Playern der Branche. Trends, neue Ein- und Ansichten sind ihr Metier – und die Frage: „richtig kommuniziert?“</p>");	
		}
		
		$(this).children('.p_overlay').show().css('top', '0');			
		if ($('.flash_1_1 .p_overlay span').size() == 0) {
			$(this).children('.p_overlay').append('<span>Schliessen</span>');	
			$('.flash_1_1 .p_overlay span').click(function () {
				$('.flash_1_1 .p_overlay').hide();
			});
		}
    });
    */
	
 
    
    $(".case-latest-item").mouseenter(function () {
		$(this).children('.overlay').animate({top: '0'}, 1);		
    });
    $(".case-latest-item").mouseleave(function () {
		$(this).children('.overlay').animate({top: '242'}, 1);	
    });
    $(".case-header-item").mouseenter(function () {
		$(this).children('.overlay').animate({top: '0'}, 1);		
    });
    $(".case-header-item").mouseleave(function () {
		$(this).children('.overlay').animate({top: '242'}, 1);	
    });
    
    $(".image_241px").mouseenter(function () {
		$(this).children('.pic-overlay').animate({top: '0'}, 1);		
    });
    $(".image_241px").mouseleave(function () {
		$(this).children('.pic-overlay').animate({top: '242'}, 1);		
    });
    
    
    $("ul.subnav").parent().append("<span></span>"); //Only shows drop down trigger when js is enabled (Adds empty span tag after ul.subnav*)

	$("ul.topnav li span").click(function() { //When trigger is clicked...

		//Following events are applied to the subnav itself (moving subnav up and down)
		$(this).parent().find("ul.subnav").show(); //Drop down the subnav on click

		$(this).parent().hover(function() {
		}, function(){
			$(this).parent().find("ul.subnav").slideUp('fast'); //When the mouse hovers out of the subnav, move it back up
		});

		//Following events are applied to the trigger (Hover events for the trigger)
		}).hover(function() {
			$(this).addClass("subhover"); //On hover over, add class "subhover"
		}, function(){	//On Hover Out
			$(this).removeClass("subhover"); //On hover out, remove class "subhover"
	});
	
	
	
	if($('.layout_standard_2_c.job-list-item.prakt').children().size() != 0) {
		$('.tx-dmmjobcontrol-pi1').each(function(idx) {
			var prakt_block = $(this);
			// $(this).find('.layout_block_2').first().show();
			
			first_block = $(this).find('.layout_block_1').first();
			first_block.find('h1').show();
			first_block.css('padding-bottom', '15px');
			var tmp_menu = '';
			$(this).children().each(function(index) {
				tmp_menu += '<h2 id="p-' + idx + '-' + index + '" rel="'+ idx + '-' + index + '">' + $(this).find('.layout_block_1 h2').html() + '</h2>';
				$(this).find('.layout_block_2').addClass('prakt-' + idx + '-' + index);
					
			});
			
			first_block.append(tmp_menu);
			// first_block.find('h2#p-' + idx + '-0').addClass('active');
				
			first_block.find('h2').click(function () {
				target_idx = $(this).attr('rel');	
				prakt_block.find('.layout_block_2').hide();
				$('.layout_standard_2_c.job-list-item .prakt-' + target_idx).appendTo(prakt_block.children().first()).show();
				prakt_block.find('.active').removeClass();
				$(this).addClass('active');
			});
			
			prakt_block.find('.close_bg').click(function () {
				prakt_block.find('.layout_block_2').hide();
				prakt_block.find('.active').removeClass();
			});
		});
	}
	
	$('#powermaildiv_uid17 input').replaceWith('<span class="submit-button">Senden</span>');
	$('#powermaildiv_uid17').click(function() {
  		$('#onlinebewerbung').submit();
	});	
	
	$('#powermaildiv_uid36 input').replaceWith('<span class="submit-button">Senden</span>');
	$('#powermaildiv_uid36').click(function() {
  		$('#kontakt').submit();
	});
	
	$('#powermaildiv_uid45 input').replaceWith('<span class="submit-button-en">Send</span>');
	$('#powermaildiv_uid45').click(function() {
  		$('#kontakt').submit();
	});
	
	$('.tx-comments-comment-form .i77 input').replaceWith('<span class="submit-button">Senden</span>');
	$('.tx-comments-comment-form .i77').click(function() {
  		$('#comment-form').submit();
	});
	
	$('#kontakt').parents('.layout_standard_2_b').css('background', 'none');
	
	/*
	$('#uid3').csb({
		style: 'dropdown1',
		mode: 'select',
		callback: function(arg){
			onSelectMoodul(arg);
		}
	});
	*/

	if ($('#uid20').text() != '') {
		$('#uid20').csb({
			style: 'dropdown1',
			mode: 'select',
			callback: function(arg){
				onSelectMoodul(arg);
			}
		});
	}
	
	if ($('#uid37').text() != '') {
		$('#uid37').csb({
			style: 'dropdown1',
			mode: 'select',
			callback: function(arg){
				onSelectMoodul(arg);
			}
		});
	}
	
	jQuery('.image_slider div.2slide:first').addClass("2slide vis");
	
	if ($('.2slide img').size() > 1) { 
		$('.image_slider .images div.2slide').each(function(idx) {
			// alert($(this).attr('style')); 
		});
		
		if ($('.image_slider .images .vis script').size() == 1) {
    		$('.previous').addClass('pn-mini');
    		$('.next').addClass('pn-mini');
    	} else {
    		$('.previous').removeClass('pn-mini');
    		$('.next').removeClass('pn-mini');
    	}
	
		$('.image_slider .next').click(function () {
				var idx_tmp = $('.image_slider .images .vis').index();
				if (idx_tmp != $('.image_slider .images div.2slide').size() - 1) {
					$('.image_slider .images .vis').attr('class','2slide').next().attr('class','2slide vis');
				} else {
					$('.image_slider .images .vis').attr('class','2slide');
					$('.image_slider div.2slide:first').attr('class','2slide vis');
				}
				
				if ($('.image_slider .images .vis script').size() == 1) {
    				$('.previous').addClass('pn-mini');
    				$('.next').addClass('pn-mini');
    			} else {
    				$('.previous').removeClass('pn-mini');
    				$('.next').removeClass('pn-mini');
    			}
    	});
    	$('.image_slider .previous').click(function () {
				var idx_tmp = $('.image_slider .images .vis').index();
				if (idx_tmp != 0) {
					$('.image_slider .images .vis').attr('class','2slide');
					$('.image_slider .images div.2slide:eq('+(idx_tmp-1)+')').attr('class','2slide vis');
				} else {
					$('.image_slider .images .vis').attr('class','2slide');
					$('.image_slider div.2slide:last').attr('class','2slide vis');
				}
				
				if ($('.image_slider .images .vis script').size() == 1) {
    				$('.previous').addClass('pn-mini');
    				$('.next').addClass('pn-mini');
    			} else {
    				$('.previous').removeClass('pn-mini');
    				$('.next').removeClass('pn-mini');
    			}
    	});
    	
    	
	
		$('.previous').mouseenter(function () {
			$(this).css('background', 'url("/fileadmin/templates/images/slider_prev.gif") no-repeat scroll left top transparent');		
   	 	});
    
   	 	$('.previous').mouseleave(function () {
			$(this).css('background', 'none');		
    	});
    
	    $('.next').mouseenter(function () {
			$(this).css('background', 'url("/fileadmin/templates/images/slider_next.gif") no-repeat scroll right top transparent');		
	    });
	    
	    $('.next').mouseleave(function () {
			$(this).css('background', 'none');		
	    });
    } else {
    	$('.previous').remove();
    	$('.next').remove();
    }
    
    $('.news-list-item.news').each(function(idx) {
		var news_block = $(this);
		var nhref = news_block.find('.news-list-morelink a').attr('href');
		if (news_block.find('a img').size() == 1) {
			// news_block.find('h2').before('<img width="362" height="210" src="/fileadmin/user_upload/content_de/_demo/pic_362x210_default.jpg" alt="" title=""/>');
			news_block.find('h2').before('<a href="'+nhref+'"><img width="362" height="210" src="/fileadmin/user_upload/content_de/04_neues/362x210px_default.jpg" alt="" title=""/></a>');
		}
	});
	
	$('.header_pic_txt.news').each(function(idx) {
		var news_block = $(this);
		
		if (news_block.children('img').size() == 0) {
			// news_block.find('div').before('<img width="725" height="330" src="/fileadmin/user_upload/content_de/_demo/pic_725x330_default.jpg" alt="" title=""/>');
			news_block.find('div').before('<img width="725" height="330" src="/fileadmin/user_upload/content_de/04_neues/725x330px_default.jpg" alt="" title=""/>');
		}
	});
	
	$('.news-realsingle-item').each(function(idx) {
		var news_block = $(this);
		if (news_block.find('.news-single-img img').size() == 0) {
			// news_block.find('.news-single-img').append('<img width="362" height="210" src="/fileadmin/user_upload/content_de/_demo/pic_362x210_default.jpg" alt="" title=""/>');
			news_block.find('.news-single-img').append('<img width="362" height="210" src="/fileadmin/user_upload/content_de/04_neues/362x210px_default.jpg" alt="" title=""/>');
		}
	});

       // $('.layout_standard_2_b .layout_block_2 .kopf-1-3:last').css('padding-bottom', '3px');
	
	$('.do-search').click(function() {
                $(".s_result_title").hide();
                $(".title-agentur").hide();
                $(".title-referenz").hide();
                $(".title-neues").hide();
                $(".title-karriere").hide();
                $(".title-presse").hide();
                $(".title-alle").hide();

                $(".result-agentur").hide();
                $(".result-referenz").hide();
                $(".result-neues").hide();
                $(".result-karriere").hide();
                $(".result-presse").hide();
                $(".result-alle").hide();
		/*
		$('.a-news-header').html('<img class="ajax-loader" src="/fileadmin/templates/images/ajax-loader.gif" />');
		$(".a-news-header").load(nurl, function() {
			$('.ajax-loader').hide();
		});
		*/
		$(".s_result_title").show();
		if( $('#agentur_s').attr('checked')){
			$(".title-agentur").show();
			$('.title-agentur').append('<img class="ajax-loader" src="/fileadmin/templates/images/ajax-loader.gif" />');
			$(".result-agentur").load('/index.php?id=259&tx_indexedsearch[results]=100&tx_indexedsearch[sword]='+$(".fa-s-box").val()+'&tx_indexedsearch[sections]=rl1_6', function() {
				$(".result-agentur").show();
				$('.result-agentur .tx-title').each(function() {
					var descr_title = $(this);
					var t = descr_title.html();
					descr_title.html(t.replace('_1_','').replace('_2_',''));
				});
				$('.result-agentur .descr-block').each(function() { 
					var descr_block = $(this);
					var t = descr_block.html();
					descr_block.html(t.replace('_1_','').replace('_2_',''));
					descr_block.find('.morelink').click(function() {
						descr_block.find('.tx-descr').show();
					});
				});
				$('.title-agentur .ajax-loader').remove();
			});
		}
		if( $('#referenz_s').attr('checked')){
			$(".title-referenz").show();
			$('.title-referenz').append('<img class="ajax-loader" src="/fileadmin/templates/images/ajax-loader.gif" />');
			$(".result-referenz").load('/index.php?id=259&tx_indexedsearch[results]=100&tx_indexedsearch[sword]='+$(".fa-s-box").val()+'&tx_indexedsearch[sections]=rl1_7', function() {
				$(".result-referenz").show();
				$('.result-referenz .tx-title').each(function() {
					var descr_title = $(this);
					var t = descr_title.html();
					descr_title.html(t.replace('_1_','').replace('_2_',''));
				});
				$('.result-referenz .descr-block').each(function() { 
					var descr_block = $(this);
					var t = descr_block.html();
					descr_block.html(t.replace('_1_','').replace('_2_',''));
					descr_block.find('.morelink').click(function() {
						descr_block.find('.tx-descr').show();
					});
				});
				$('.title-referenz .ajax-loader').remove();
			});
		}
		if( $('#neues_s').attr('checked')){
			$(".title-neues").show();
			$('.title-neues').append('<img class="ajax-loader" src="/fileadmin/templates/images/ajax-loader.gif" />');
			$(".result-neues").load('/index.php?id=259&tx_indexedsearch[results]=100&tx_indexedsearch[sword]='+$(".fa-s-box").val()+'&tx_indexedsearch[sections]=rl1_8', function() {
				$(".result-neues").show();
				$('.result-neues .tx-title').each(function() {
					var descr_title = $(this);
					var t = descr_title.html();
					descr_title.html(t.replace('_1_','').replace('_2_',''));
				});
				$('.result-neues .descr-block').each(function() { 
					var descr_block = $(this);
					var t = descr_block.html();
					descr_block.html(t.replace('_1_','').replace('_2_',''));
					descr_block.find('.morelink').click(function() {
						descr_block.find('.tx-descr').show();
					});
				});
				$('.title-neues .ajax-loader').remove();
			});
		}
		if( $('#karriere_s').attr('checked')){
			$(".title-karriere").show();
			$('.title-karriere').append('<img class="ajax-loader" src="/fileadmin/templates/images/ajax-loader.gif" />');
			$(".result-karriere").load('/index.php?id=259&tx_indexedsearch[results]=100&tx_indexedsearch[sword]='+$(".fa-s-box").val()+'&tx_indexedsearch[sections]=rl1_9', function() {
				$(".result-karriere").show();
				$('.result-karriere .tx-title').each(function() {
					var descr_title = $(this);
					var t = descr_title.html();
					descr_title.html(t.replace('_1_','').replace('_2_',''));
				});
				$('.result-karriere .descr-block').each(function() { 
					var descr_block = $(this);
					var t = descr_block.html();
					descr_block.html(t.replace('_1_','').replace('_2_',''));
					descr_block.find('.morelink').click(function() {
						descr_block.find('.tx-descr').show();
					});
				});
				$('.title-karriere .ajax-loader').remove();
			});
		}
		if( $('#presse_s').attr('checked')){
			$(".title-presse").show();
			$('.title-presse').append('<img class="ajax-loader" src="/fileadmin/templates/images/ajax-loader.gif" />');
			$(".result-presse").load('/index.php?id=259&tx_indexedsearch[results]=100&tx_indexedsearch[sword]='+$(".fa-s-box").val()+'&tx_indexedsearch[sections]=rl1_13', function() {
				$(".result-presse").show();
				$('.result-presse .tx-title').each(function() {
					var descr_title = $(this);
					var t = descr_title.html();
					descr_title.html(t.replace('_1_','').replace('_2_',''));
				});
				$('.result-presse .descr-block').each(function() { 
					var descr_block = $(this);
					var t = descr_block.html();
					descr_block.html(t.replace('_1_','').replace('_2_',''));
					descr_block.find('.morelink').click(function() {
						descr_block.find('.tx-descr').show();
					});
				});
				$('.title-presse .ajax-loader').remove();
			});
		}
		if( $('#alle_s').attr('checked')){
			$(".title-alle").show();
			$('.title-alle').append('<img class="ajax-loader" src="/fileadmin/templates/images/ajax-loader.gif" />');
			$(".result-alle").load('/index.php?id=259&tx_indexedsearch[results]=100&tx_indexedsearch[sword]='+$(".fa-s-box").val()+'&tx_indexedsearch[sections]=rl3_2', function() {
				$(".result-alle").show();
				$('.result-alle .tx-title').each(function() {
					var descr_title = $(this);
					var t = descr_title.html();
					descr_title.html(t.replace('_1_','').replace('_2_',''));
				});
				$('.result-alle .descr-block').each(function() { 
					var descr_block = $(this);
					var t = descr_block.html();
					descr_block.html(t.replace('_1_','').replace('_2_',''));
					descr_block.find('.morelink').click(function() {
						descr_block.find('.tx-descr').show();
					});
				});
				$('.title-alle .ajax-loader').remove();
			});
		}
		
		
		/*
		
		*/
	});
	//EB
	$('.fa-s-box').live("keypress", function(e) {
			if (e.keyCode == 13) {
	
                $(".s_result_title").hide();
                $(".title-agentur").hide();
                $(".title-referenz").hide();
                $(".title-neues").hide();
                $(".title-karriere").hide();
                $(".title-presse").hide();
                $(".title-alle").hide();

                $(".result-agentur").hide();
                $(".result-referenz").hide();
                $(".result-neues").hide();
                $(".result-karriere").hide();
                $(".result-presse").hide();
                $(".result-alle").hide();
		/*
		$('.a-news-header').html('<img class="ajax-loader" src="/fileadmin/templates/images/ajax-loader.gif" />');
		$(".a-news-header").load(nurl, function() {
			$('.ajax-loader').hide();
		});
		*/
		$(".s_result_title").show();
		if( $('#agentur_s').attr('checked')){
			$(".title-agentur").show();
			$('.title-agentur').append('<img class="ajax-loader" src="/fileadmin/templates/images/ajax-loader.gif" />');
			$(".result-agentur").load('/index.php?id=259&tx_indexedsearch[results]=100&tx_indexedsearch[sword]='+$(".fa-s-box").val()+'&tx_indexedsearch[sections]=rl1_6', function() {
				$(".result-agentur").show();
				$('.result-agentur .tx-title').each(function() {
					var descr_title = $(this);
					var t = descr_title.html();
					descr_title.html(t.replace('_1_','').replace('_2_',''));
				});
				$('.result-agentur .descr-block').each(function() { 
					var descr_block = $(this);
					var t = descr_block.html();
					descr_block.html(t.replace('_1_','').replace('_2_',''));
					descr_block.find('.morelink').click(function() {
						descr_block.find('.tx-descr').show();
					});
				});
				$('.title-agentur .ajax-loader').remove();
			});
		}
		if( $('#referenz_s').attr('checked')){
			$(".title-referenz").show();
			$('.title-referenz').append('<img class="ajax-loader" src="/fileadmin/templates/images/ajax-loader.gif" />');
			$(".result-referenz").load('/index.php?id=259&tx_indexedsearch[results]=100&tx_indexedsearch[sword]='+$(".fa-s-box").val()+'&tx_indexedsearch[sections]=rl1_7', function() {
				$(".result-referenz").show();
				$('.result-referenz .tx-title').each(function() {
					var descr_title = $(this);
					var t = descr_title.html();
					descr_title.html(t.replace('_1_','').replace('_2_',''));
				});
				$('.result-referenz .descr-block').each(function() { 
					var descr_block = $(this);
					var t = descr_block.html();
					descr_block.html(t.replace('_1_','').replace('_2_',''));
					descr_block.find('.morelink').click(function() {
						descr_block.find('.tx-descr').show();
					});
				});
				$('.title-referenz .ajax-loader').remove();
			});
		}
		if( $('#neues_s').attr('checked')){
			$(".title-neues").show();
			$('.title-neues').append('<img class="ajax-loader" src="/fileadmin/templates/images/ajax-loader.gif" />');
			$(".result-neues").load('/index.php?id=259&tx_indexedsearch[results]=100&tx_indexedsearch[sword]='+$(".fa-s-box").val()+'&tx_indexedsearch[sections]=rl1_8', function() {
				$(".result-neues").show();
				$('.result-neues .tx-title').each(function() {
					var descr_title = $(this);
					var t = descr_title.html();
					descr_title.html(t.replace('_1_','').replace('_2_',''));
				});
				$('.result-neues .descr-block').each(function() { 
					var descr_block = $(this);
					var t = descr_block.html();
					descr_block.html(t.replace('_1_','').replace('_2_',''));
					descr_block.find('.morelink').click(function() {
						descr_block.find('.tx-descr').show();
					});
				});
				$('.title-neues .ajax-loader').remove();
			});
		}
		if( $('#karriere_s').attr('checked')){
			$(".title-karriere").show();
			$('.title-karriere').append('<img class="ajax-loader" src="/fileadmin/templates/images/ajax-loader.gif" />');
			$(".result-karriere").load('/index.php?id=259&tx_indexedsearch[results]=100&tx_indexedsearch[sword]='+$(".fa-s-box").val()+'&tx_indexedsearch[sections]=rl1_9', function() {
				$(".result-karriere").show();
				$('.result-karriere .tx-title').each(function() {
					var descr_title = $(this);
					var t = descr_title.html();
					descr_title.html(t.replace('_1_','').replace('_2_',''));
				});
				$('.result-karriere .descr-block').each(function() { 
					var descr_block = $(this);
					var t = descr_block.html();
					descr_block.html(t.replace('_1_','').replace('_2_',''));
					descr_block.find('.morelink').click(function() {
						descr_block.find('.tx-descr').show();
					});
				});
				$('.title-karriere .ajax-loader').remove();
			});
		}
		if( $('#presse_s').attr('checked')){
			$(".title-presse").show();
			$('.title-presse').append('<img class="ajax-loader" src="/fileadmin/templates/images/ajax-loader.gif" />');
			$(".result-presse").load('/index.php?id=259&tx_indexedsearch[results]=100&tx_indexedsearch[sword]='+$(".fa-s-box").val()+'&tx_indexedsearch[sections]=rl1_13', function() {
				$(".result-presse").show();
				$('.result-presse .tx-title').each(function() {
					var descr_title = $(this);
					var t = descr_title.html();
					descr_title.html(t.replace('_1_','').replace('_2_',''));
				});
				$('.result-presse .descr-block').each(function() { 
					var descr_block = $(this);
					var t = descr_block.html();
					descr_block.html(t.replace('_1_','').replace('_2_',''));
					descr_block.find('.morelink').click(function() {
						descr_block.find('.tx-descr').show();
					});
				});
				$('.title-presse .ajax-loader').remove();
			});
		}
		if( $('#alle_s').attr('checked')){
			$(".title-alle").show();
			$('.title-alle').append('<img class="ajax-loader" src="/fileadmin/templates/images/ajax-loader.gif" />');
			$(".result-alle").load('/index.php?id=259&tx_indexedsearch[results]=100&tx_indexedsearch[sword]='+$(".fa-s-box").val()+'&tx_indexedsearch[sections]=rl3_2', function() {
				$(".result-alle").show();
				$('.result-alle .tx-title').each(function() {
					var descr_title = $(this);
					var t = descr_title.html();
					descr_title.html(t.replace('_1_','').replace('_2_',''));
				});
				$('.result-alle .descr-block').each(function() { 
					var descr_block = $(this);
					var t = descr_block.html();
					descr_block.html(t.replace('_1_','').replace('_2_',''));
					descr_block.find('.morelink').click(function() {
						descr_block.find('.tx-descr').show();
					});
				});
				$('.title-alle .ajax-loader').remove();
			});
		}
		return false;
		
		}
	});
	//EB_END
	
	if ($('.fa-s-box').val() == '') { 
		$('.fa-s-box').val('Suchbegriff');
	}
	
	if ($('.fa-s-box').val() == 'Suchbegriff') {
		$('.fa-s-box').clearField();
	}

        if ($('.news-search-form input').val() == '') {
		$('.news-search-form input').val('Suchbegriff');
	}

	if ($('.news-search-form input').val() == 'Suchbegriff') {
		$('.news-search-form input').clearField();
	}
	
	$(".checkb input").click(function(event){
		var n = $(".checkb input:checked").length;
		
                if (n == 0) {
                    $("#alle_s").attr("checked","checked");
                }

		if($(this).attr('name') == 'alle_search' && $(this).attr('checked') == true) {
			$(".checkb input#agentur_s").removeAttr("checked");	
			$(".checkb input#referenz_s").removeAttr("checked");	
			$(".checkb input#neues_s").removeAttr("checked");	
			$(".checkb input#karriere_s").removeAttr("checked");	
			$(".checkb input#presse_s").removeAttr("checked");			
		}

		
		if($(this).attr('name') != 'alle_search' && n > 0) {
			$(".checkb input").last().removeAttr("checked");				
		}		
	});
	
	$('.news-menu .news-search-form .news-search-form-submit').append('<span class="do-search">Suchen</span>');

        $('.news-menu .do-search').click(function() {
            $('.news-menu form').submit();
            return;
            //$('.news-menu .news-search-emptyMsg').show();
        });

        if($('.news-menu .news-list-container').length > 0) {
             $('.news-menu .news-list-container').hide();
        }

        if($('.news-list-container .news-list-item.news').length > 0) {
             $('#content_inner > .news-search-form').hide();
        }
        
        if($('.news-menu.presse .press-list-container').length > 0) {
             $('.news-menu.presse .press-list-container').hide();
        }

        if($('.press-list-container .press-list-item').length > 0) {
             $('.layout_block_1 > .news-search-form').hide();
        }
        
/*if($('.advisors-header').length > 0) {
			$('.advisors-header .slides').cycle({
				fx: 'scrollHorz',
				next: '.studie-next',
				prev: '.studie-prev',
				rev: 1,
				timeout: 0
			});
		}*/
         // alert('*');

});

function onSelectMoodul(selected){
	$('.hide').hide();
	$("#moodul_"+selected).show();
}


function ref_fade_back(direction)
{
	
	if (direction == 1) {
  		$('.image_slider .images .2slide:first').fadeOut("fast",
        function() {
        	$(this).remove().appendTo(".image_slider .images"); // alert('a');
            $('.image_slider .images .2slide:first').fadeIn("fast"); // alert('b');
            // jQuery('#pic_month').remove();
            // jQuery('#is_pic_month .picBorder').after('<span id="pic_month">Pic of the month</span>');
        });
    } else {
      	$('.image_slider .images .2slide:first').fadeOut("fast",
        function() {  	
        	$('.image_slider .images .2slide:last').remove().prependTo(".image_slider .images").fadeIn("fast");
        	// jQuery('#pic_month').remove();
            // jQuery('#is_pic_month .picBorder').after('<span id="pic_month">Pic of the month</span>');
		});
    }
}

function ref_fade(direction)
{
	/*
	if (direction == 1) {
  		$('.image_slider .images .2slide:first').fadeOut("fast",
        function() {
        	// $(this).remove().appendTo(".image_slider .images"); // alert('a');
            // $('.image_slider .images .2slide:first').fadeIn("fast"); // alert('b');
            $(this).next().fadeIn("fast");
            // jQuery('#pic_month').remove();
            // jQuery('#is_pic_month .picBorder').after('<span id="pic_month">Pic of the month</span>');
        });
    } else {
      	$('.image_slider .images .2slide:first').fadeOut("fast",
        function() {  	
        	$('.image_slider .images .2slide:last').remove().prependTo(".image_slider .images").fadeIn("fast");
        	// jQuery('#pic_month').remove();
            // jQuery('#is_pic_month .picBorder').after('<span id="pic_month">Pic of the month</span>');
		});
    }
    */
}

function resetForm(form) {
  $(':input', $(form)).each(function(i, item) {
    switch(item.tagName.toLowerCase()) {
      case 'input':
        switch(item.type.toLowerCase()) {
          case 'hidden':
          case 'text':
            item.value = '';
          break;
          case 'radio':
          case 'checkbox':
            item.checked = '';
          break;
        }
      break;
      case 'select':
        item.selectedIndex = 0;
      break;
      case 'textarea':
        item.value = '';
      break;
    }
  });
}

var requiredMajorVersion = 9;
// Erforderliche Unterversion von Flash
var requiredMinorVersion = 0;
// Erforderliche Flash-Revision
var requiredRevision = 124;


(function($) {
	
	$.fn.clearField = function(settings) {
		
		/**
		 * Settings
		 * 
		 */
		
		settings = jQuery.extend({
			blurClass: 'clearFieldBlurred',
			activeClass: 'clearFieldActive',
			attribute: 'rel',
			value: ''
		}, settings);
		
		
		/**
		 * loop each element
		 * 
		 */
		
		return $(this).each(function() {
			
			/**
			 * Set element
			 * 
			 */
			
			var el = $(this);
			
			
			/**
			 * Get starting value
			 * 
			 */
			
			settings.value = el.val();
			
			
			/**
			 * Add or get attribute
			 * 
			 */
			
			if(el.attr(settings.attribute) == undefined) {
				el.attr(settings.attribute, el.val()).addClass(settings.blurClass);
			} else {
				settings.value = el.attr(settings.attribute);
			}
			
			
			/**
			 * Set focus action
			 * 
			 */
			
			el.focus(function() {
				
				if(el.val() == el.attr(settings.attribute)) {
					el.val('').removeClass(settings.blurClass).addClass(settings.activeClass);
				}
				
			});
			
			
			/**
			 * Set blur action
			 * 
			 */
			
			el.blur(function() {
				
				if(el.val() == '') {
					el.val(el.attr(settings.attribute)).removeClass(settings.activeClass).addClass(settings.blurClass);
				}
				
			});
			
			
		});
		
	};
	
})(jQuery);

 
function Log()
{
    this.enabled = false;
};

$.extend(Log.prototype,
{
    enable : function() {
		this.enabled = true;
    },
    
    disable : function() {
		this.enabled = false;
    },
    
    log : function(s)
    {
	if (!this.enabled)
	    return;
	if ($("#_firebugConsole").length == 1)
	{
	    console.log(s);
	}
    }
});

var C = new Log();

// usage:
C.enable();       // enable logger
C.log("Hallo");  // print Hallo to console
// console.debug("debug"); 
// console.log("Init...");



 

