function makeScrollbar(content,scrollbar,handle,horizontal,ignoreMouse,arrStepsCorrection,arrControls){
	content = $(content);
	//alert(content.innerHTML);
	//(horizontal == "horizontal") ? true:false
	var fxGoTo = new Fx.Styles(content, {duration:800, transition:Fx.Transitions.Sine.easeInOut});
	var stepAfterCorrection = (arrStepsCorrection["i"]*arrStepsCorrection["x"])-(arrStepsCorrection["i"]-1);	
	var steps = (horizontal? (content.getSize()["scrollSize"]["x"] -  stepAfterCorrection) : (content.getSize()["scrollSize"]["y"] - arrStepsCorrection["y"]) );
	//steps = steps*1.03;
	//steps = steps+20;
	//debugger;
	
	slider = new Slider(scrollbar, handle, {	
		steps: steps,
		mode: (horizontal?"horizontal":"vertical"),
		onChange: function(step){
			//alert(step);
			var x = (horizontal?step:0);
			var y = (horizontal?0:step);
			
			if(horizontal){
			
				iLeft = (x != 0) ? (-1)*(x) : 0;
				
				iLeft = iLeft * (arrStepsCorrection["x"]);

				fxGoTo.stop().start({left : iLeft}); 
				
			} else {
				fxGoTo.stop().start({top : -y});				
			}

			
		}
	}).set(0);
	//debugjm(slider);
	//if(!window.ie7) slider.set(0);

	if( !(ignoreMouse) ){
		// Scroll the content element when the mousewheel is used within the 
		// content or the scrollbar element.
		$$("#body", content, scrollbar).addEvent('mousewheel', function(e){
			var wheelAccaleration = 1;
			if(!horizontal) wheelAccaleration = 50;

			e = new Event(e).stop();
			var step = slider.step - (e.wheel*wheelAccaleration);
			slider.set(step);
		});
	}
	
	if(arrControls != null || arrControls == "false"){
		//alert(arrControls);
		document.addEvent("keydown", function(event){
			
			var keyAccaleration = 1;
			if(!horizontal) keyAccaleration = 50;

			switch(event.keyCode) {
				case 37:	// Left arrow
				case 38:	// Down arrow
				case 80:	// 'p'
					var step = slider.step - (1*keyAccaleration);
					break;	
				case 39:	// Right arrow
				case 40:	// Up arrow
				case 78:	// 'n'
					var step = slider.step + (1*keyAccaleration);
					break;
				default:
					return true;
			}
			slider.set(step);
			// Prevent default keyboard action (like navigating inside the page)
			return false;
			
		});
	}

	// Stops the handle dragging process when the mouse leaves the document body.
	//$("body").addEvent('mouseleave',function(){slider.drag.stop()});
}

//http://webfreak.no/wp/2007/09/05/get-for-mootools-a-way-to-read-get-variables-with-javascript-in-mootools/
function $get(key,url){  
     if(arguments.length < 2) url =location.href;  
     if(arguments.length > 0 && key != ""){  
         if(key == "#"){  
             var regex = new RegExp("[#]([^$]*)");  
         } else if(key == "?"){  
             var regex = new RegExp("[?]([^#$]*)");  
         } else {  
             var regex = new RegExp("[?&]"+key+"=([^&#]*)");  
         }  
         var results = regex.exec(url);  
         return (results == null )? "" : results[1];  
     } else {  
         url = url.split("?");  
         var results = {};  
             if(url.length > 1){  
                 url = url[1].split("#");  
                 if(url.length > 1) results["hash"] = url[1];  
                 url[0].split("&").each(function(item,index){  
                     item = item.split("=");  
                     results[item[0]] = item[1];  
                 });  
             }  
         return results;  
     }  
}

window.setHash =  function(hashValue){		
	window.location.href = window.location.href.split('#')[0] + "#" + hashValue;
}