<!--
//Start fleXcroll using any method you like, prefer to use external scripts to do this,
//This is for easy viewing of the method used to initialize the script.
if (document.getElementById && document.getElementsByTagName) {
if (window.addEventListener) window.addEventListener('load', initScrollBars, false);
else if (window.attachEvent) window.attachEvent('onload', initScrollBars);
}

function initScrollBars() {
CSBfleXcroll('targetArea2');

}


//following are just for demonstration.


//Demonstration functions for dynamic changes, not required for running fleXcroll.
function insertRemoveP(reMove) {
var targetEl = document.getElementById('targetArea2');
var scrollDiv = document.getElementById('test1');
if (targetEl == null || scrollDiv == null) return;

if (typeof(targetEl.parS) == 'undefined') targetEl.parS = new Array();
if (!reMove) {
targetEl.parS[targetEl.parS.length] = document.createElement('p');
targetEl.parS[targetEl.parS.length-1].appendChild(document.createTextNode('Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Pellentesque ultrices facilisis risus. Aenean sollicitudin imperdiet justo.'));
targetEl.appendChild(targetEl.parS[targetEl.parS.length-1]);
} else if (targetEl.parS.length > 0) {
targetEl.parS[targetEl.parS.length-1].parentNode.removeChild(targetEl.parS[targetEl.parS.length-1]);
targetEl.parS.length = targetEl.parS.length - 1;
}
//Following is the method to tell fleXcrolled div to update itself.
scrollDiv.scrollUpdate();
}

function makeWideNarrow() {
var targetEl = document.getElementById('targetArea2');
var scrollDiv = document.getElementById('test1');
if (targetEl == null || scrollDiv == null) return;
if (targetEl.parentNode.className=='dynamic') targetEl.parentNode.className = 'fixedsize';
else targetEl.parentNode.className='dynamic';
scrollDiv.scrollUpdate();
}

function cleanTestDiv() {
var targetEl = document.getElementById('targetArea2');
var scrollDiv = document.getElementById('test1');
if (targetEl != null) targetEl.innerHTML = '';
if (typeof(targetEl.parS) != 'undefined') targetEl.parS = new Array();
targetEl.parentNode.className = 'dynamic';
scrollDiv.scrollUpdate();
}

//a basic example external module to control scroll from outside
//NOT required for fleXcroll to run, and user do NOT need to
//know what this is for standard operation.
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.commitScroll(x,y,relative);
	/*
	Following is the method to commit a scroll by
	simulating scrollbar movement:
		element.commitScroll(x,y,relative);
	*x and y values are horizontal and vertical
	positions of scrollbars 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 scrollbar position and
	not scrolled content position.
	*e.g. To scroll one page down, you can:
	element.commitScroll(false,"1p",true);
	*e.g. To scroll 3 steps to left, you can:
	element.commitScroll("-3s",false,true);
	*e.g. To set the vertical scrollbar at 30px right, and 20px down:
	element.commitScroll()	
	*/
}

//a basic example to external module to scroll content to a desired point,
//or relatively in pixels.
//NOT required for fleXcroll to run, and user do NOT need to
//know what this is for standard operation.
function fleXcrollContentTo(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);
	/*
	Following is the method to commit a content scroll by desired pixels,
	or scroll-jump to a location:
		element.contentScroll(x,y,relative);
	*x and y are integer values which are horizontal and vertical
	positions in pixels and whichever not needed can be set as "false"
	*relative can either be "true" or "false".
	If false, the content is scrolled to given location.
	If true, content is relatively scrolled in pixels.
	*e.g. To scroll content to 100px, 40px:
	element.contentScroll(100,40,false);
	*e.g. To scroll down 100px relatively,
	element.contentScroll(false,100,true)
	*/
}



//-->
