﻿/// <reference path="~/js/jquery-1.3.2-vsdoc.js"/>

; (function($) {
	$.fn.fixFixed = function(locations) {
		if ($.browser.msie && parseInt($.browser.version) <= 6) {
			var that = this,
				locations = $.isArray(locations) ? locations : [locations];
			that.css('position', 'absolute');
			$(window).scroll(function() {
				if ($.inArray('top', locations) != -1) {
					that.css('top', $(window).scrollTop() + 'px');
				}
				if ($.inArray('left', locations) != -1) {
					that.css('left', $(window).scrollLeft() + 'px');
				}
				if ($.inArray('bottom', locations) != -1) {
					that.css('bottom', 'auto');
					that.css('top', ($(window).scrollTop() + $(window).height() - that.outerHeight(true)) + 'px');
				}
				if ($.inArray('right', locations) != -1) {
					that.css('right', 'auto');
					that.css('left', ($(window).scrollLeft() + $(window).width() - that.outerWidth(true)) + 'px');
				}
			});
		}
	};
})(jQuery);     // plugin code end;