jQuery(document).ready(function() { // facelift FLIR.init( { path: facelift_path } ); //preventSearch = false; $('#navigation span').each(function() { $(this).css('font-size', '21px'); $(this).css('line-height', '1.1em'); FLIR.replace(this, new FLIRStyle({ cFont:'condensed', mode:'wrap' }) ); }); $('#content h1 em').each(function() { $(this).css('font-size', '38px'); $(this).css('line-height', '1.1em'); FLIR.replace(this, new FLIRStyle({ cFont:'condensed', mode:'wrap' }) ); }); $('#content h4 em').each(function() { $(this).css('font-size', '32px'); $(this).css('line-height', '1.1em'); FLIR.replace(this, new FLIRStyle({ cFont:'condensed', mode:'wrap' }) ); }); $('#content h5 em').each(function() { $(this).css('font-size', '21px'); $(this).css('line-height', '1.1em'); FLIR.replace(this, new FLIRStyle({ cFont:'condensed', mode:'wrap' }) ); }); /*$('#content caption').each(function() { $(this).css('font-size', '20px'); $(this).css('line-height', '1.1em'); FLIR.replace(this, new FLIRStyle({ cFont:'condensed', mode:'wrap' }) ); });*/ $('#sidebar h5 em').each(function() { $(this).css('font-size', '20px'); $(this).css('line-height', '1.1em'); FLIR.replace(this, new FLIRStyle({ cFont:'condensed', mode:'wrap' }) ); }); apprenticeshipOfTheWeek.init(); map.init('#map', 53.716216, 12.425537); collapsible.init(); search.init("0"); var flashvars = {}; var params = {}; params.quality = "best"; params.wmode = "window"; params.menu = "false"; params.allowfullscreen = "false"; var attributes = {}; swfobject.embedSWF("main/xtras/flash/mv_quiz.swf", "flashQuiz", "230", "270", "8.0.0", false, flashvars, params, attributes); }); var facelift_path; var popup = { open : function(url, width, height) { mvpopup = window.open(url, "mvpopup", "width="+width+",height="+height); mvpopup.focus(); return false; } }; var global = { map : false, slideshow : false, locations : new Array() }; var variables = { map : { current : 0 }, boundaries: false, slideshow : { delay : 8000, autostart : true } }; var search = { init : function(defaultvalue) { // initialize multiple selectboxes var wrapper = jQuery('#azubiatlasWrapper'); if(wrapper.length == 0) return; var selectboxes = jQuery('select[name^="filter"][multiple="multiple"]', wrapper); var defaultOptions = $(selectboxes).find('option[value="' + defaultvalue + '"]'); $(selectboxes).find('option').click(function() { if(this.selected == true) { if(this.value == "0") { $(this).parent().find('option[value!="' + this.value + '"]').each(function() { this.selected = false; }); } else if(this.value == "") { this.selected = false; } else { $(this).parent().find('option[value="0"]').each(function() { this.selected = false; }); } } }); // initialize ajax-request var selectbox = jQuery('select[name^="filter[0]"]', wrapper).get(0); $(selectbox).change(function() { var filter = ''; $(this).find('option:selected').each(function() { filter += (filter == '') ? this.value : ',' + this.value; }); jQuery.getJSON(basepath + "/ajax/getpositions/?categories=" + filter, function(response) { var target = jQuery('select[name^="filter[1]"]', wrapper).get(0); var selected = new Array(); $(target).find('option:selected').each(function() { selected[this.value] = true; }); $(target).find('option[value!="0"]').remove(); $.each(response, function(index, position) { if(selected[position.id]) { $(target).append(''); } else { $(target).append(''); } }); if($(target).find('option:selected').length == 0) { $(target).find('option[value="0"]').each(function() { this.selected = true; }); } }); }); } } var map = { init : function(selector, latitude, longitude) { var canvas = jQuery(selector).get(0); if(canvas) { var center = new google.maps.LatLng(latitude, longitude); global.map = new google.maps.Map2(canvas); global.map.disableDragging(); global.map.setCenter(center, 8); variables.map.boundaries = new google.maps.LatLngBounds(); if(locations.length > 0) { for(var location in locations) { location = locations[location]; map.addLocation(location['latitude'], location['longitude'], 'mapRelation' + location['id']); } var level = global.map.getBoundsZoomLevel(variables.map.boundaries); if(level < 7) { level = 7; } if(level > 9) { level = 9; } global.map.setCenter(variables.map.boundaries.getCenter(), level); if(variables.slideshow.autostart == true) { map.slideshowStart(); } } } }, addLocation : function(latitude, longitude, relation) { var index = global.locations.length; global.locations[index] = { index : index, coordinates : new google.maps.LatLng(latitude, longitude), overlay : (relation) ? jQuery('#' + relation) : false, relation : (relation) ? jQuery('.' + relation) : false }; variables.map.boundaries.extend(global.locations[index].coordinates); if(global.locations[index].overlay) { var pointer = jQuery(''); pointer.prependTo(global.locations[index].overlay); pointer.css('position', 'absolute'); pointer.css('left', Math.ceil((global.locations[index].overlay.outerWidth() - 9) / 2)); pointer.css('bottom', '-5px'); global.locations[index].overlay.appendTo(global.map.getPane(G_MAP_FLOAT_SHADOW_PANE)); } //jQuery("
  • ").html("Point " + (index + 1)).click( function() { map.moveTo(global.locations[index], true) }).appendTo("#locations"); }, slideshowStart : function(delay, index) { if(!global.slideshow) { if(!delay) { delay = variables.slideshow.delay; } if(!index) { index = variables.map.current; } variables.slideshow.delay = delay; variables.map.current = index; map.slideshowPlay(); } }, slideshowPlay : function() { if(!global.slideshow) { map.moveTo(global.locations[variables.map.current]); global.slideshow = window.setInterval("map.slideshowNext()", variables.slideshow.delay); } }, slideshowPause : function() { if(global.slideshow) { window.clearInterval(global.slideshow); global.slideshow = false; } }, slideshowStop : function() { if(global.slideshow) { map.slideshowPause(); variables.map.current = 0; } }, slideshowToggle : function() { if(!global.slideshow) { map.slideshowPlay(); } else { map.slideshowPause(); } }, slideshowNext : function() { variables.map.current += 1; if(variables.map.current >= global.locations.length) { variables.map.current = 0; } if(global.slideshow) { map.slideshowPause(); map.moveTo(global.locations[variables.map.current]); map.slideshowPlay(); } else { map.moveTo(global.locations[variables.map.current]); } }, slideshowPrevious : function() { variables.map.current -= 1; if(variables.map.current < 0) { variables.map.current = global.locations.length - 1; } if(global.slideshow) { map.slideshowPause(); map.moveTo(global.locations[variables.map.current]); map.slideshowPlay(); } else { map.moveTo(global.locations[variables.map.current]); } }, moveTo : function(location, pause) { if(location.overlay) { var listener = google.maps.Event.addListener(global.map, "moveend", function() { map.showOverlay(location); google.maps.Event.removeListener(listener); }); if(location.coordinates.equals(global.locations[variables.map.current].coordinates)) { google.maps.Event.removeListener(listener); map.showOverlay(location); } } if(location.relation) { map.showRelation(location); } if(pause && global.slideshow) { map.slideshowPause(); } variables.map.current = location.index; global.map.panTo(location.coordinates); }, showOverlay : function(location) { if(location.overlay) { jQuery.each(global.locations, function() { if(this.overlay != false && this.index != location.index) { map.hideOverlay(this); } }); var position = global.map.fromLatLngToDivPixel(location.coordinates); position.x -= Math.ceil(location.overlay.outerWidth() / 2); position.y -= location.overlay.outerHeight() + 7; location.overlay.fadeIn('default').css({ top: position.y, left: position.x }); } }, hideOverlay : function(location) { if(location.overlay) { location.overlay.hide(); } }, showRelation : function(location) { if(location.overlay) { jQuery.each(global.locations, function() { if(this.relation != false && this.index != location.index) { map.hideRelation(this); } }); location.relation.show(); } }, hideRelation : function(location) { if(location.relation) { location.relation.hide(); } } } var collapsible = { init : function() { // initialize collapsible tables var tables = jQuery('table.collapsible'); $(tables).each(function() { if($(this).hasClass('active') == false) { $(this).toggleClass('inactive'); } $(this).find('caption').click(function() { var parent = $(this).parent().get(0); $(parent).toggleClass('inactive'); }); }); } } var $buoop = {} $buoop.ol = window.onload; window.onload=function(){ if ($buoop.ol) $buoop.ol(); var e = document.createElement("script"); e.setAttribute("type", "text/javascript"); e.setAttribute("src", "http://browser-update.org/update.js"); document.body.appendChild(e); } var apprenticeshipOfTheWeek = { init : function(){ jQuery('.adw-content').not(jQuery('.adw-content:first')).hide(); jQuery('.adw-headline').click(function(){ ele = $(this).parent(); action = (ele.hasClass('active') == true) ? jQuery('.adw-content', ele).hide().parent().removeClass('active'): jQuery('.adw-content', ele).fadeIn('slow').parent().addClass('active'); }); } }