// JavaScript Document
function jfx_setscrollleft() {
	if(document.getElementById)
	{
		var currentthumb = document.getElementById('currentthumb');
		var imagepreview = document.getElementById('imagepreview');
		if(currentthumb && imagepreview)
		{
			imagepreview.scrollLeft = currentthumb.offsetLeft - 40; //minus margins/paddings
			if(currentthumb.previousSibling) { //IE fix
				imagepreview.scrollLeft = currentthumb.offsetLeft - 40;
			}
			else {
				imagepreview.scrollLeft = 0;
			}
			
			
			//alert(imagepreview.scrollLeft + '\n' + currentthumb.offsetLeft + '\n' + jfx_findPos(currentthumb)[0] + '\n' + currentthumb.previousSibling)
		}
	}
}


function jfx_findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		do {
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;
		} 
		while (obj = obj.offsetParent);
	}
	
	return [curleft,curtop];
}
