﻿$(function () {
	if(navigator.platform == 'iPad' || navigator.platform == 'iPhone' || navigator.platform == 'iPod')
	{
		$("#footer").css("position", "static");
	};
});

$(function () {
	$(document).ready(function () {
		var top = $('#subContentFix').offset().top - parseFloat($('#subContentFix').css('marginTop').replace(/auto/, 0));
		$(window).scroll(function (event) {
			var y = $(this).scrollTop();
			if (y >= top) {
				$('#subContentFix').addClass('fixed');
			} else {
				$('#subContentFix').removeClass('fixed');
			}
		});
	});
});

$(function () {
	$(document).ready(function(){
		$("a[rel='slideshow'], a[rel='slideshow1']").colorbox({previous:"ZURÜCK", next:"WEITER", current:"Bild {current} von {total}", close:"SCHLIESSEN", slideshowStart:"Diaschau starten", slideshowStop:"Diaschau anhalten", returnFocus:false, slideshowSpeed:3500, slideshow:true});
	});
});

$(function () {
	$(document).ready(function(){
		$("a[rel='picture']").colorbox({previous:"ZURÜCK", next:"WEITER", current:"Bild {current} von {total}", close:"SCHLIESSEN", slideshowStart:"Diaschau starten", slideshowStop:"Diaschau anhalten", returnFocus:false});
	});
});

$(function () {
	$(document).ready(function(){
		$("a[rel='document']").colorbox({previous:"ZURÜCK", next:"WEITER", current:"Dokument {current} von {total}", close:"SCHLIESSEN", slideshowStart:"Diaschau starten", slideshowStop:"Diaschau anhalten", returnFocus:false});
	});
});

$(function () {
	$(document).ready(function(){
		$(".SendMessage").colorbox({width:"560", height:"410", scrolling:false, returnFocus:false, fixed:true, iframe:true});
	});
});

$(function () {
  $('.bubbleInfo').each(function () {
    var distance = 10;
    var time = 250;
    var hideDelay = 500;
    var hideDelayTimer = null;
    var beingShown = false;
    var shown = false;
    var trigger = $('.trigger', this);
    var popup = $('.popup', this).css('opacity', 0);
    $([trigger.get(0), popup.get(0)]).mouseover(function () {
      if (hideDelayTimer) clearTimeout(hideDelayTimer);
      if (beingShown || shown) {
        return;
      } else {
        beingShown = true;
        popup.css({
          top: -100,
          left: -33,
          display: 'block'
        })
        .animate({
          top: '-=' + distance + 'px',
          opacity: 1
        }, time, 'swing', function() {
          beingShown = false;
          shown = true;
        });
      }
    }).mouseout(function () {
      if (hideDelayTimer) clearTimeout(hideDelayTimer);
      hideDelayTimer = setTimeout(function () {
        hideDelayTimer = null;
        popup.animate({
          top: '-=' + distance + 'px',
          opacity: 0
        }, time, 'swing', function () {
          shown = false;
          popup.css('display', 'none');
        });
      }, hideDelay);
    });
  });
});

function fncReload(sort1, sort2, sort3) {
	index = window.document.frmEinheit.crew.selectedIndex;
	sURL = "index.php?crew=" + window.document.frmEinheit.crew.options[index].value + "&frmDrpDwnSort1=" + sort1 +  "&frmDrpDwnSort2=" + sort2 + "&frmDrpDwnSort3=" + sort3;
	window.location.href =  sURL;
}

