/*
* Floating Banner jQuery Plugin v1.0
* http://code.google.com/p/floatingbanner/
*
* Copyright 2010, Funke Web Solutions
* Released under the GPL Version 3 license.
*
* $Id$
*/
(function(a) {
    jQuery.fn.floatingbanner = function(h) {
        function d(b, c) { a(b).addClass("floating-banner"); a(c).show(); !e.ie6 && a.browser.msie && parseInt(jQuery.browser.version) == 6 && a(b).css({ top: a(window).scrollTop(), position: "absolute" }) } function i(b, c) { a(b).removeClass("floating-banner"); a(c).hide(); !e.ie6 && a.browser.msie && parseInt(jQuery.browser.version) == 6 && a(b).css({ position: "static" }) } function f(b, c) { if (c < b) return false; return true } var e = jQuery.extend({ ie6: true }, h), g = []; this.each(function() {
            var b = a("<div></div>").height(a(this).outerHeight()).width(a(this).outerWidth()).hide().insertBefore(this),
c = a(this).position().top; g.push({ banner: this, placeholder: b, posTop: c }); var j = a(window).scrollTop(); f(c, j) && d(this, b)
        }); a(window).scroll(function() { var b = a(window).scrollTop(); a(g).each(function() { f(this.posTop, b) ? d(a(this.banner), a(this.placeholder)) : i(a(this.banner), a(this.placeholder)) }) })
    }
})(jQuery);

 

/*
 * Floating Banner jQuery Plugin v1.0
 * http://code.google.com/p/floatingbanner/
 *
 * Copyright 2010, Funke Web Solutions
 * Released under the GPL Version 3 license.
 *
 * $Id: jquery.floatingbanner.js 4172 2010-04-05 05:57:21Z rob $
 */
(function($) {
	jQuery.fn.floatingbanner = function (options) {
		
		var settings = jQuery.extend({
	     ie6: true
	  }, options);
		
	  var banners = new Array();
	  this.each(function(){
	    var placeholder = $('<div></div>').height($(this).outerHeight()).width($(this).outerWidth()).hide().insertBefore(this);
	    var posTop = $(this).position().top;
	    banners.push({'banner':this,'placeholder':placeholder,'posTop':posTop});
			var scrollTop = $(window).scrollTop();
	    if(pastView(posTop, scrollTop))
	      floatBanner(this, placeholder);
	  });
	
	  function floatBanner(element, placeholder){
	    $(element).addClass('floating-banner');
	    $(placeholder).show();
	    if (!settings.ie6 && $.browser.msie && parseInt(jQuery.browser.version) == 6) {
	      $(element).css({'top': $(window).scrollTop(), 'position': 'absolute'});
	    }
	  }
	
	  function unFloatBanner(element, placeholder){
	    $(element).removeClass('floating-banner');
	    $(placeholder).hide();
			if (!settings.ie6 && $.browser.msie && parseInt(jQuery.browser.version) == 6) {
        $(element).css({'position': 'static'});
      }
	  }
	
	  function pastView(posTop, scrollTop){
	    if (scrollTop < posTop)
	      return false;
	    return true;
	  };
	
	  $(window).scroll(function(){
			var scrollTop = $(window).scrollTop();
	    $(banners).each(function(){
	      if(pastView(this.posTop, scrollTop))
	        floatBanner($(this.banner), $(this.placeholder));
	      else
	        unFloatBanner($(this.banner), $(this.placeholder));
	    });
	  });
	};
})(jQuery);
