﻿
/*
Following is the method to commit a scroll by defining
relative or absolute values:
	element.contentScroll(x,y,relative);
*x and y values are horizontal and vertical
positions of content and can be set to false if we don't
require any one of them to be scrolled.
*x and y should be sent as string, between quotation marks.
*x and y can take three different units:
px, s, p
where px is pixels, s is a single step, p is a page scroll.
*relative can be either true or false. If true,
x and y is used as relative scrolling.
*x and y refer to content position
*e.g. To scroll one page down, you can:
element.contentScroll(false,"1p",true);
*e.g. To scroll 3 steps to left, you can:
element.contentScroll("-3s",false,true);
*e.g. To set the content at 30px right, and 20px down:
element.contentScroll("30px","20px",false);
*e.g. To scroll down 100px relatively,
element.contentScroll(false,"100px",true);
*/
			
function fleXcrollTo(id,x,y,relative) 
{					
	var scrollDiv = document.getElementById(id);
	
	//Return if the target is not a fleXcrolled div.
	if (scrollDiv == null || !scrollDiv.fleXcroll) return;
	
	//Do the scroll by using custom method attached by fleXcroll
	scrollDiv.contentScroll(x,y,relative);
}
