jQuery(function(){
  $(".img-swap").hover(
    function(){this.src = this.src.replace("_default","_selected");},
    function(){this.src = this.src.replace("_selected","_default");});
});
 $.viewportHeight = function() {
  return self.innerHeight ||
    jQuery.boxModel && document.documentElement.clientHeight ||
    document.body.clientHeight;
    };
if (-1 != navigator.userAgent.indexOf("MSIE 6")) {
  $(document).ready(function(){
	// Mindesthöhe simulieren
    $('div').each(function(){
    	var min = $(this).css('min-height');
    	if (typeof(min) != 'undefined' && min != 'auto') {
    		min = min.replace(/\D/, '');
    		min = parseInt(min);
    		if (!isNaN(min) && min > 0 ) {
    			var h = $(this).height();
    			if (h < min) {
    				$(this).css('height', min + 'px');
    			}
    		}
    	}
    });
  });
}
function footer() {
  var v = $.viewportHeight();
  var f = $('#footerContainer').height();
  var s = $('#siteContainer').height();
  if (f+s < v) {
    var m = v-f-s;
    $('#footerContainer').css('position', 'relative');
    $('#footerContainer').css('top', m + 'px');

  }
  else {
    $('#footerContainer').css('position', 'relative');
    $('#footerContainer').css('top', 0 + 'px');
  }
/*
  var o = $('#footerContainer').offset();
  var h = v - $('#footerContainer').height();
  var m = h - o.top;
console.log(m+" "+v);
if (0 < m) {
    $('#footerContainer').css('position', 'relative');
    $('#footerContainer').css('top', m + 'px');
  }*/
}
function doPNGs(){
  $('#haendlersuche').ifixpng();
  $('.pngImg').ifixpng();
  $('.png').ifixpng();
  $('#blogNaviSeason').ifixpng();
  $('#blogNaviCauses').ifixpng();
  $('#naviElements').ifixpng();
}
$(window).load(function(){
  footer();
  doPNGs();
  
/* $(window).resize(function() {
    footer();
});*/

  $('input[name=plz]').focus(function(){
  	if ("PLZ" == $(this).val()) {
  		$(this).val('');
  	}
  });
  $('input[name=plz]').blur(function(){
  	if ("" == $(this).val()) {
  		$(this).val('PLZ');
  	}
  });
});
window.onresize = function() {
  footer();
};

