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("