var currentPage = 1; var dontOpenJob = false; window.onbeforeprint = function(){ $(".ui-draggable").css('left', 0); currentPage = 1; }; $(document).ready(function(){ // Replace escaped @ sign in email adresses /*$("span.mail a, a.mail").each(function() { $(this).text($(this).text().replace("(at)", "@")); });*/ $("body").html( $("body").html().replace(/\(at\)/g,"@")); if ($('.personnavi .suchtext').val() == '') { $('.personnavi .suchtext').val('Mitarbeitende suchen'); } $('.personnavi .suchtext').click(function(){ $('.personnavi .suchtext').val(''); }); $('.personnavi .lupe').click(function(){ if ($('.personnavi .suchtext').val() == '') { return false; } if ($('.personnavi .suchtext').val() == 'Mitarbeitende suchen' ) { return false; } return true; }); $('#searchbox .lupe').click(function(){ if ($('#searchbox .suchtext').val()== '' ) { return false; } return true; }); }); var prevActive=false, nextActive=false; $(window).load(function(){ var navi = $("#secondnavigation ul").children().size(); if (navi == 0) { $('#secondnavigation').children().css('display','none'); } var box = $(".box-left").children().size(); if (box == 0){ $(".box-left").css('background-image', 'none'); } var text = $(".box-left .textinhalt").children().size(); var adress = $(".box-left .adresse").children().size(); if (adress == 0){ $(".box-left .adresse").css('background-image', 'none'); } if (adress == 0 && text == 0 ){ $(".box-left").css('background-image', 'none'); } $(".titel, .beschreib, .details").click(function(){ $('#wrapper > .popUpJob').remove(); $(this).parent().find('.popUpJob').clone().appendTo("#wrapper"); $('#wrapper > .popUpJob').show(); $('#wrapper > .popUpJob .schliessen').click(function(){$(this).parents('.popUpJob').remove()}); // $('.drucken').click(function(){window.print();}); }); /**/ var page=0; $('.slide > li > div > div.tx-indexedsearch > div.tx-indexedsearch-res > *').appendTo('.slide > li > div:first'); $('.slide > li > div > *').each(function(){ if(page > 0) { $(this).appendTo("#page-"+page); } var lowerPos = $(this).offset().top+$(this).height()-$("#content").offset().top; if(lowerPos > 507 || ($(this).is('h2') && $(this).prev().length > 0 )) { page++; $("
  • ").appendTo(".slide"); $(this).prev("h2, h1").appendTo("#page-"+page); $(this).appendTo("#page-"+page); } }); if($('.slide > li').length > 1){ // $("#slideOuter").easySlider({controlsShow: true, prevText:'', nextText: ''}); $(".slide").carousel({afterStart: function(){dontOpenJob=true}, afterStop: function(){setArrows();dontOpenJob=false}}); if($(".ui-draggable > li").length > 1) { $("").click(moveLeft).appendTo(".pfeil-links"); $("").click(moveRight).appendTo(".pfeil-rechts"); $('.prev').click(moveLeft); $('.next').click(moveRight); } } if(jQuery.trim(searchWords) != ''){ var wordArray = jQuery.trim(searchWords).toLowerCase().split(" "); } var personen = $('#content .mask .personinfo'); if(personen.length){ if(wordArray){ $('#content .mask .personinfo').each(function(index){ var text = $("h2", $(this)).first().parent().text().toLowerCase(); var match = false; $.each( wordArray, function( key, value ) { if(text.indexOf(value) >= 0) { match = true; }else{ match = false; return false; } } ); if(match){ i = index; if(index > 2){ i = index-2; } if(index <= 2){ i = personen.length - (2-index); } return false; } }); }else{ var i = parseInt( Math.random() * personen.length ); } while(i > 0){ $('#content .mask .personinfo:first').clone().appendTo($('#content .mask')); $('#content .mask .personinfo:first').remove(); i--; } } $('#content .mask .personinfo:eq(2) .inhalt').clone().appendTo('#personal .inhalt-ausgabe'); /*$('.inhalt-ausgabe').css('display','block');*/ // $('#content .mask .personinfo:first').clone().appendTo($('#content .mask')); $('#personal .pfeil-rechts').click(function(){ if(nextActive) return true; nextActive=true; $('#content .mask .personinfo:first').clone().appendTo($('#content .mask')); $('#content .mask .personinfo:first').animate({width:0}, 500, '' ,function(){ $(this).remove(); $('#personal .inhalt-ausgabe').html(''); $('#content .mask .personinfo:eq(2) .inhalt').clone().appendTo('#personal .inhalt-ausgabe'); nextActive=false; }) }); $('#personal .pfeil-links').click(function(){ if(prevActive) return true; prevActive=true; $('#content .mask .personinfo:last').clone().css('width', 0).insertBefore($('#content .mask .personinfo:first')); $('#content .mask .personinfo:first').animate({width:194}, 500, '' ,function(){ $('#content .mask .personinfo:last').remove(); $('#personal .inhalt-ausgabe').html(''); $('#content .mask .personinfo:eq(2) .inhalt').clone().appendTo('#personal .inhalt-ausgabe'); prevActive=false; }) }); if ($('.pfeil-links img').length > 0) { $('#slideOuter').addClass('mehr'); } else { $('.prev').css('display','none'); $('.next').css('display','none'); } if($('input[type=file]').length > 0){ $('input[type=file]').styleFileInput({ addClearLink : true, textTagName : 'normal', clearLinkText : ['', ''], textAttributes : { text : 'Keine Datei ausgewählt.' }, buttonAttributes : { value: "Datei Upload" } }); } var isDragging = false; var dragXPos = 0; $(".maske").mousedown(function(e){ isDragging = true; dragXPos = e.pageX; return false; }); $(document).mouseup(function(){ isDragging = false; }); $(".maske").mousemove(function(e){ if(isDragging){ diff = e.pageX - dragXPos; if(diff < 0){ dragLeft(-diff); }else{ dragRight(diff); } dragXPos = e.pageX; } return false; }); setArrows(); }); function moveRight(){ var pixels = 610; if($("#jobs").length > 0) { pixels = 540; } if(currentPage < $(".ui-draggable > li").length){ $(".ui-draggable").animate({ left: "-=" + pixels}, 500); currentPage++; } setArrows(); } function moveLeft(){ var pixels = 610; if($("#jobs").length > 0) { pixels = 540; } if(currentPage > 1){ $(".ui-draggable").animate({ left: "+=" + pixels}, 500); currentPage--; } setArrows(); } function setArrows() { if($(".ui-draggable").length ) { if (currentPage >= $(".ui-draggable > li").length ) { $('.pfeil-rechts').css('display','none'); $('.next').css('display','none'); } else { $('.pfeil-rechts').css('display','inline'); $('.next').css('display','block'); } if (currentPage == 1 ) { $('.pfeil-links').css('display','none'); $('.prev').css('display','none'); } else { $('.pfeil-links').css('display','inline'); $('.prev').css('display','block'); } } } function activateJobLink(e){ if(!dontOpenJob){ $('#wrapper > .popUpJob').remove(); $(e).find(".titel").parents(".jobangebot").find('.popUpJob').clone().appendTo("#wrapper"); $('#wrapper > .popUpJob').show(); $('#wrapper > .popUpJob .schliessen').click(function(){$(this).parents('.popUpJob').remove()}); /*Wenn keine PDFs vorhanden sind, wird der Text nicht angezeigt */ if ($(".popUpJob:visible .plain > a").size() === 0){ $(".popUpJob:visible .plain").hide(); } } } function dragLeft(pixels){ var f = $('#content .mask .personinfo:first'); if(!(nextActive==true || prevActive==true)){ $('#personal .pfeil-rechts').click(); } /* if(pixels > f.width()){ }else{ f.width(f.width()-pixels); } */ } function dragRight(pixels){ var f = $('#content .mask .personinfo:first'); if(!(nextActive==true || prevActive==true)){ $('#personal .pfeil-links').click(); } /* if(f.width()+pixels > 194){ }else{ f.width(f.width()+pixels); } */ }