// listScroll
$(function(){
	$("ul#ticker01").liScroll({travelocity: 0.03});
});
//toolTip
$(function(){
	$(".tooltip").tipTip({defaultPosition: "top"});
	$(".navitip").tipTip({defaultPosition: "bottom"});
	$(".footertip").tipTip({defaultPosition: "right"});
});
// stickyNavigation
var nav = navigator.userAgent.toLowerCase();
// navigation position
var initialPos      = 380;
var initialHeight   = 40;
// wo ist die navigation relativ zum fenster
$(window).scroll(function() {
	var scrollY         = (typeof (window.pageYOffset) == 'number') ? window.pageYOffset : (document.body && document.body.scrollTop) ? document.body.scrollTop : (document.documentElement && document.documentElement.scrollTop) ? document.documentElement.scrollTop : 0;
	var scrollX         = (typeof (window.pageXOffset) == 'number') ? window.pageXOffset : (document.body && document.body.scrollLeft) ? document.body.scrollLeft : (document.documentElement && document.documentElement.scrollLeft) ? document.documentElement.scrollLeft : 0;
	var top             = scrollY - (initialPos -0);
	// verticalScroll
	if (top > 0) {
		var diff = 0;
		var iediff = scrollY + 0;
		// mobil devices
		if (($.browser.msie && $.browser.version == '6.0') || nav.indexOf('mobile safari') > -1 || nav.indexOf('iphone') > -1 || nav.indexOf('Nokia') > -1) {
			$('#navigation').css({position:'absolute',top:iediff+'px'});
		}
		// standard browser
		else {
			$('#navigation').css({position:'fixed',top:diff+'px'});
			$('#left').css({margin:'80px 0 0 15px'});
			$('#right').css({margin:'80px 15px 0 0'});
		}
		// horizontalScroll
		if ((scrollX-11) > 0) {
			var diff = '-'+(scrollX-11);
			var iediff = 11;
			// mobil devices
			if (($.browser.msie && $.browser.version == '6.0') || nav.indexOf('mobile safari') > -1 || nav.indexOf('iphone') > -1 || nav.indexOf('Nokia') > -1) {
				$('#navigation').css({position:'absolute',left:iediff+'px'});
			}
			// standard browser
			else {
				$('#navigation').css({position:'fixed',left:diff+'px'});
			}
		}
		else {
			$('#navigation').css({left:'auto'});
		}
	}
	else {
		$('#navigation').css({position:'static',top:'auto','left':'auto'});
		// ausgleich height navigation
		$('#left').css({margin:'40px 0 0 15px'});
		$('#right').css({margin:'40px 15px 0 0'});
	}
});
// prettyFoto
$(function() {
	swapValues = [];
	$(".swap_value").each(function(i){
	swapValues[i] = $(this).val();
	$(this).focus(function(){
		if ($(this).val() == swapValues[i]) {
			$(this).val("");
		}
	}).blur(function(){
		if ($.trim($(this).val()) == "") {
			$(this).val(swapValues[i]);
		}
	});
	});
});
// countDown
$(function () {
	var austDay = new Date();
	austDay = new Date(2011, 9-1, 3);
	$('#defaultCountdown').countdown({until: austDay, format: 'odHM'});
	$('#year').text(austDay.getFullYear());
});

