var hideSearch, hideSearchTimeout, schedule;
var insertSchedule=function() {
$("#top").append(schedule);
if($.browser.msie && $.browser.version < 7)
DD_belatedPNG.fix('#scrollpaneEnd');
$('#scrollpane').jScrollPane({showArrows:true,maintainPosition:false,animateTo:false});
/*
$("#schedule_location").multiSelect({
selectAllText: 'Alle wählen:',
oneOrMoreSelected: '*',
noneSelected: 'Wählen Sie eine Stadt:'
},function() {
loadScheduleData(true);
});
*/
loadScheduleData(false);
if(jQuery.browser.opera || jQuery.browser.mozilla) {
$("#schedule .multiSelectOptions").css("margin-top","-3px");
}
}
var loadScheduleData=function(hide) {
$("#scrollpane").html('
');
$("#schedule_padding").animate({
height: 78+($.browser.safari?5:0)
}, 500 );
$("#scrollpane").height(19);
$(".jScrollArrowUp,.jScrollArrowDown,.jScrollPaneTrack").animate({
opacity:0
},100);
$("#scrollpane").css("top","0");
$("#scheduleAddInfo").animate({
height:4
},500).find("div:first").css("border-top","0");
// $('#schedule .multiSelectOptions').hide();
$.post(
"/_prg/ajax_flight_data.php",
{
locations: " "
},
function(data) {
if(data && data.length && data.replace(/[\r\n\s]*/,"").length) {
$("#scrollpane").html(data);
$("#scheduleAddInfo div:first").html($("#scrollpane #addInfo").html());
if(String($("#scheduleAddInfo div:first").text()).replace(/[\r\n\s]*/,"").length) {
$("#scheduleAddInfo").show();
$("#scheduleAddInfo").animate({
height:$("#scheduleAddInfo div:first").outerHeight()
},500).find("div:first").css("border-top","1px solid black");
}
}
if(!$("#scrollpane tr").length) {
$("#scrollpane").html("Keine Flüge für Ihre Auswahl...");
var elHeight=20;
}
else
var elHeight=$('#scrollpane table').height();
$("#schedule_padding").animate({
height: Math.min(elHeight+68+($.browser.safari?5:0),260)
}, 500 )
$("#scrollpane").animate({
height: Math.min(elHeight,200)
}, 500 );
$(".jScrollPaneContainer").animate({
height: Math.min(elHeight,200)
}, 500 ).fadeTo(500,1,function(){
if($.browser.msie && $.browser.version < 7) {}
else {
$(this).css("height","200px");
}
$('#scrollpane').jScrollPane({showArrows:true,maintainPosition:false,animateTo:false});
$(".jScrollArrowUp,.jScrollArrowDown,.jScrollPaneTrack").animate({
opacity:1
},400);
});
}
);
}
var fixHeight=function() {
$("#top").height("auto").height($("#frame").height());
}
$(window).load(fixHeight);
$(window).bind('resize',fixHeight);
Shadowbox.loadSkin('classic', '/_js/shadowbox/skin');
Shadowbox.loadLanguage(shadowLang, '/_js/shadowbox');
Shadowbox.loadPlayer(['img', 'flv', 'iframe', 'html'], '/_js/shadowbox');
var player;
function playerReady(obj) {
if(obj && typeof obj['id']!='undefined' && $.browser.msie) {
player = document.getElementById(obj['id']);
player.sendEvent("PLAY","true");
}
};
var teaserDir;
function switchStartTeaser(id) {
var currentTeaser=$("#screener ul.pagination li").index($("#screener ul.pagination li.active")[0]);
var clickedTeaser=$("#screener ul.pagination li").index($("#screener ul.pagination li#l_"+id)[0]);
if(currentTeaser==clickedTeaser)
return false;
if(clickedTeaser").attr("src",$("#screener2").css("background")).preload({onFinish:function(){
if(teaserDir=="l") {
var s2=-980; //ende teaser1
var s3=980; //start teaser2
}
else {
var s2=980; //ende teaser1
var s3=-980; //start teaser2
}
$("#screener2").css('left',s3+'px').animate( { left:"0px" }, 500 ).fadeTo(500,1,function(){
$(this).css('left','0');
$("#screener").remove();
$("#screener2").attr("id","screener");
});
$("#screener").animate( { left:s2+"px" }, 500 );
$("#startseite #screener object,#startseite #screener embed").css('visibility',"hidden");
$('#screener2 object[@data$=.swf]').each(function() {
// swfobject.embedSWF($(this).attr("data"), $(this).parent().generateId().attr("id"), $(this).attr("width"), $(this).attr("height"), "9.0.0","/_js/expressInstall.swf",false,{flashvars: $(this).find("param[@name=flashvars]").attr("value"),allowfullscreen:"true"});
});
if($.browser.msie && $.browser.version<7) {
$('#screener2 #startTeaserLinks a').ifixpng('/_img/layout/pixel.gif');
$('#screener2 embed[@src$=.swf]').each(function() {
// swfobject.embedSWF($(this).attr("src"), $(this).parent().generateId().attr("id"), $(this).attr("width"), $(this).attr("height"), "9.0.0","/_js/expressInstall.swf",false,{flashvars: $(this).attr("flashvars"),allowfullscreen:"true"});
});
}
}});
}
}
);
return false;
}
$(document).ready(function() {
/* Ticker auf der Startseite */
if($('#startseite .ticker #marquee').length != 0) {
$('#startseite .ticker #marquee').marquee({
yScroll: "top",
showSpeed: 850,
scrollSpeed: 20,
pauseOnHover: true,
pauseSpeed: 500
});
$('#startseite .col2 h1').first().css('margin-top', '15px');
}
/* Menu */
$('ul#hauptnavigation > li').each(function() {
if( ($(this).find('> a span').text() == 'Spenden') || ($(this).find('a span').text() == 'Donate') ) {
$(this).addClass('active donate');
}
});
/* Confirm external links */
$('#bildungsspender-link-extern').click(function() {
if(!confirm("Sie werden nun zu www.bildungsspender.de weitergeleitet.")) {
return false;
}
});
/*Shadowbox.init();*/
Shadowbox.init({
onOpen: function() {
$('#shadowbox_body').before($('#shadowbox_info'));
$('#shadowbox_body').after($('#shadowbox_title'));
}
});
if($.browser.msie && $.browser.version < 7) {
DD_belatedPNG.fix('#frame,#startseite #footer,#logo,.rBlockImg');
$('#startTeaserLinks a').ifixpng('/_img/layout/pixel.gif');
$('img[@src$=.png]').ifixpng('/_img/layout/pixel.gif');
}
schedule='';
$("#scheduleLink").toggle(function(){
$("#scheduleLink").blur();
$(this).addClass("active");
$('#content object').css('visibility',"hidden");
if(!document.getElementById("schedule")) {//erster aufruf
insertSchedule();
if($.browser.msie) {
$("#schedule").show();
}
else {
$("#schedule").animate({
opacity:1
},200);
}
}
else {
if($.browser.msie) {
$("#schedule").show();
}
else {
$("#schedule").animate({
opacity:1
},200);
}
$("#schedule").css("display","block");
if($.browser.msie && $.browser.version < 7)
$("#schedule").prev().css("display","block");
}
return false;
},function(){
$("#scheduleLink").blur();
$(this).removeClass("active");
$('#content object').css('visibility',"visible");
if($.browser.msie) {
$("div#schedule").hide();
}
else {
$("#schedule").fadeTo(200,0,function(){
$(this).css("display","none");
});
}
/*
if($.browser.msie && $.browser.version < 7) {
$("#schedule").prev().css("display","none");
}
*/
return false;
});
if($.browser.msie && $.browser.version < 7) {
$("#hauptnavigation li").hover(function(){
$(this).addClass("hover");
},function(){
$(this).removeClass("hover");
})
}
$("#header ul li:last a").click(function(){
if(!$("#searchForm").length) {
$("#header").append('').find("form").animate({opacity:1},200).find("input:first").focus();
$("#header form").hover(function(){
hideSearch=false;
if(hideSearchTimeout)
window.clearTimeout(hideSearchTimeout);
},function(){
hideSearch=true;
window.setTimeout(function(){
if(hideSearch) {
$("#searchForm").fadeTo(200,0,function(){
$(this).remove();
});
}
},1000);
});
hideSearch=false;
}
else {
$("#searchForm").fadeTo(200,0,function(){
$(this).remove();
});
}
return false;
});
if($.browser.msie && $.browser.version < 7) {
$("#logo").fadeTo(1000,1,function(){
$(this).prev().css("z-index","-1");
});
}
if(!$.browser.msie || $.browser.version>=7) {
$("#content a:not(.schedTab),#footer a:not(.noLinkHoverAction)").hover(function() {
var sel='a[href="'+this.href.replace(window.location.protocol+'//'+window.location.hostname,'')+'"],a[href="'+this.href+'"],a[href="'+this.href.replace(window.location.protocol+'//'+window.location.hostname,'').replace(/\/$/,'')+'"],a[href="'+this.href.replace(/\/$/,'')+'"]';
$(sel).each(function(){
jQuery(this).addClass("hover");
});
}, function() {
var sel='a[href="'+this.href.replace(window.location.protocol+'//'+window.location.hostname,'')+'"],a[href="'+this.href+'"],a[href="'+this.href.replace(window.location.protocol+'//'+window.location.hostname,'').replace(/\/$/,'')+'"],a[href="'+this.href.replace(/\/$/,'')+'"]';
$(sel).each(function(){
jQuery(this).removeClass("hover");
});
});
$("#scheduleTable a.schedTab").hover(function() {
var sel='a[href="'+this.href.replace(window.location.protocol+'//'+window.location.hostname,'')+'"],a[href="'+this.href+'"],a[href="'+this.href.replace(window.location.protocol+'//'+window.location.hostname,'').replace(/\/$/,'')+'"],a[href="'+this.href.replace(/\/$/,'')+'"]';
$(this).parent().parent().find(sel).each(function(){
jQuery(this).addClass("hover");
});
}, function() {
var sel='a[href="'+this.href.replace(window.location.protocol+'//'+window.location.hostname,'')+'"],a[href="'+this.href+'"],a[href="'+this.href.replace(window.location.protocol+'//'+window.location.hostname,'').replace(/\/$/,'')+'"],a[href="'+this.href.replace(/\/$/,'')+'"]';
$(this).parent().parent().find(sel).each(function(){
jQuery(this).removeClass("hover");
});
});
}
$("#hauptnavigation > li > ul").css("opacity","0");
var subNavZindex=100;
$("#hauptnavigation > li").hover(function(){
// if($.browser.opera || $.browser.mozilla)
// $("#startseite #screener object,#startseite #screener embed").css("visibility","hidden");
if(!$(this).hasClass("active")) {
$(this).find("a:first").css("border-left-color","#FFE8BD");
$(this).next().find("a").css("border-left-color","#FFE8BD");
}
$(this).find("ul").css("z-index",++subNavZindex);
$(this).find("ul").css("display","block").css("visibility","visible").fadeTo(200,1);
},function() {
// if($.browser.opera || $.browser.mozilla)
// $("#startseite #screener object,#startseite #screener embed").css("visibility","visible");
if(!$(this).hasClass("active")) {
$(this).find("a:first").css("border-left-color","#ffa700");
$(this).next().find("a").css("border-left-color","#ffa700");
}
$(this).find("ul").fadeTo(200,0,function(){
$(this).hide();
});
});
if($.browser.msie) {
$("#hauptnavigation > li").each(function(){
$(this).width($(this).width());
})
$("#hauptnavigation ul li a").each(function(){
$(this).width($(this).parent().parent().width()-16);
});
}
$('a[href^="http://"]').attr("target", "_blank");
$('#transTeaserBig').each(function() {
$(this).everyTime(8000, function(i) {
var nextItem=$('
');
nextItem.css('opacity',0);
$(this).append(nextItem);
$(this).find('li:first').remove();
$(this).find('li:last').fadeTo(1000,1);
});
});
$('#transTeaserSmall').each(function() {
$(this).everyTime(5000, function(i) {
var nextItem=$('
');
nextItem.css('opacity',0);
$(this).append(nextItem);
$(this).find('li:first').remove();
$(this).find('li:last').fadeTo(1000,1);
});
});
/* doesn't work with https
if(!$.browser.msie) {
$('a.shadowbox').click(function(){
shadowlink_content=$('').load($(this).attr('href')+" .col2",false,shadowlink_callback);
shadowlink_url=$(this).attr('href');
return false;
});
}
*/
$("#jumpTo").change(function(){
window.location.hash=$(this).find("option:selected").val();
});
if($.browser.msie) {
var shop_steps_counter=0;
$("#shop_steps li").each(function(){
$(this).prepend(++shop_steps_counter+". ");
})
}
});
var shadowlink_content, shadowlink_url;
function shadowlink_callback() {
Shadowbox.open({
player: 'html',
content: 'Druckversion'+shadowlink_content.html()+'',
height: 400,
width: 700
});
}
$(function() {
$(".infoToolTip").tooltip({
track: true,
delay: 0,
showURL: false,
opacity: 1,
fixPNG: true,
showBody: " $$$ ",
extraClass: "pretty fancy",
left: -120
});
});