jQuery.fn.mapNaviScroll = function(options) {
	var defaults = {
			speed: 1000,
			child: null,
			top: 17
	};
	var $this = jQuery(this);
	$this.options = jQuery.extend(defaults, options);
	 
	//scrollers
	var down = jQuery('<img src="/images/destinations/scroll_nuoli_down.gif" />').mousedown(function () {
		$this.down();
    }).mouseup(function () {
		$this.stop();
    });
	var up = jQuery('<img id="sUp" src="/images/destinations/scroll_nuoli.gif" />').mousedown(function () {
		$this.up();
    }).mouseup(function () {
		$this.stop();
    });

	//just to be sure, add top position also from defaults (if image not loaded...)
	var topPos = (up.height() > 0) ? up.height() : $this.options.top;
	//scrolled element
	var scrollMe = $this.options.child;
	//set scrolled element right after top scroller
	scrollMe.css('top',topPos);
	//add scroll triggers
	var upCss = {'position':'absolute','z-index':2000,'left':0,'top':0,'cursor':'pointer'}
	var downCss = {'position':'absolute','z-index':2000,'left':0,'bottom':0,'cursor':'pointer'}
	up.css(upCss);	
	down.css(downCss);	
	up.appendTo($this);
	down.appendTo($this);

	//methods
	jQuery.extend($this,{
	
		up: function() {
				return this.scroll('up');
		},
		down: function() {
				return this.scroll('down');
		},
		scroll: function(dir){
			switch(dir){
				case 'down':
					scrollMe.animate({
					top: $this.height() - scrollMe.height() - topPos
			      }, $this.options.speed);
				break;
				case 'up':
					scrollMe.animate({ 
					top: topPos
			      }, $this.options.speed);
				break;
			}			
		},
		stop: function(){
			scrollMe.stop();
		}
	
	});
};
