//Stick To
//author: Marghoob Suleman
//Date: 05th Sep, 2009
//Version: 1.0
// not completed // but can be used
//web: www.giftlelo.com | www.marghoobsuleman.com
;(function($){
	$.fn.stickto = function(position, options) {
		options = $.extend({
						   position:'top',
						   speed:100,
						   time:1,
						   spacer:3
						   },options);
		options.position = (position!=undefined) ? position : options.position;
		elementid = $(this).attr("id");
		$(this).css({position:"absolute"});
		function scrollMe(){
			var height = $(window).height();
			var scrollTop = $(window).scrollTop();
			var elementheight = $("#"+elementid).height();
			$("#"+elementid).animate({top:(scrollTop+height)-elementheight-options.spacer}, {queue:false, duration:options.time*1000});
		}
		//init;
		scrollMe();
		$(window).bind("scroll",scrollMe);
		};

})(jQuery);