//-- for IE6 but not IE7, Moz, Safari, Opera... try { if (typeof document.body.style.maxHeight == "undefined") { document.execCommand('BackgroundImageCache', false, true); } } catch(e) { /* unless it's not IE6... */ } var ua = navigator.userAgent.toLowerCase(); var isGecko = (ua.indexOf("gecko") != -1) ; var isIE = (ua.indexOf("msie") != -1) && typeof(document.all) == 'object' && (ua.indexOf("opera") == -1); var isOpera = (ua.indexOf("opera") != -1) && !isIE; var vbs_detect_pos = false; var saved_pref = $.cookie('vbs_effects'); var useEffects = saved_pref == 'false' ? false : true; // for now deaktivate effects for opera -> code a ajax workaround if (isOpera) useEffects = false; /* switch prefs -> set global var and cookie and change link background - simply not ? */ function setMyEffects() { var newValue = useEffects ? false : true; var style = 'cbox_checked'; if (isOpera && newValue) { alert('Derzeit koennen im Opera Browser die Effekte nicht verwendet werden !'); newValue = false; } if (!newValue) { $.cookie('vbs_effects','false', {expires: 30}); style = 'cbox_unchecked'; } else { $.cookie('vbs_effects','',{expires: -1}); } setPrefBackground(style); useEffects = newValue; } function setPrefBackground(style) { $('#pref_effects').css('background',' url(/vbs/img07/' + style + '.gif) 0 2px no-repeat'); } var active_tt = null; var block_tt = false; var LOADED_CONTENT = []; $(document).ready(function() { $('#pref').show(); if (useEffects) setPrefBackground('cbox_checked'); /* $('div.tip') .mouseover(function() { block_tt = true; }) .mouseout(function() { block_tt = false; }); */ $('#programm').find('a').each(function() { // Tooltip if (this.className == 'tt') { $(this) .attr('id',this.name) .bind("mouseenter",function() { if (active_tt != null) return; // detect the correct div var id=''; var txt = this.firstChild.data.trim(); switch (txt.charAt(0)) { case 'R': id='tt_reigen';break; case 'F': id='tt_fernwaerme';break; case 'H': id='tt_hdm';break; } if (id=='') return; active_tt = '#'+id; $(active_tt).css( $(this).offset() ).show(); }) .bind("mouseleave",function() { if (active_tt == null || block_tt) return; window.setTimeout(function() { if (active_tt == null || block_tt) return; $(active_tt).hide(); active_tt = null; },2000); }); } else if (this.id != 'pref_effects') { $(this).click(function() { para = this.href.split('='); if ($.inArray(para[1], LOADED_CONTENT) == -1) { // add new div and load html via ajax call $('#ajax_loader').css('position', 'absolute').css( $(this).offset() ).show(); $('
') .insertAfter($(this).parent()) .load('detail_' + para[1] + '.html?v=0.1',null, function() { $(this).show('slide', {direction:'up'}) // add click handler for detail top link .find('a.ico_top').click(function() { $(this).parent().parent().hide('slide', {direction:'up'}); }); LOADED_CONTENT.push(para[1]); window.setTimeout(function() { $('#ajax_loader').hide();}, 300); }); } else { // content is already loaded - toggle div $(this).parent().next().each(function() { if (this.style.display == 'block') $(this).hide('slide', {direction:'up'}); else $(this).show('slide', {direction:'up'}); }); } return false; }); } }); /* add nice scrollTo Effects to the Calendar */ $('#calender_navi').localScroll().find('a').click(function() { a = this.href.split('#'); var theTarget = $("a[name='"+a[1]+"']").parent().show('highlight',{duration:3500}); //return false; }); }); String.prototype.trim = function() { return this.replace(/(^\s+|\s+$)/g, ''); }