// Created by Ihor Nokolenko
isDOM=document.getElementById 
isMSIE=document.all && document.all.item 
isNetscape4=document.layers 
isOpera=window.opera 
isMozilla=isNetscape6=isDOM && !isMSIE && !isOpera 

var down = false;
var xa,ya;
startX = 960;
startY = 260;
ScrollHeight = 85;
document.onmousemove = mousemoved;
document.onmouseup = function () { down = false;}


function getElementStyle(elemID, IEStyleAttr, CSSStyleAttr) {
    var elem = document.getElementById(elemID);
    if (elem.currentStyle) {
        return elem.currentStyle[IEStyleAttr];
    } else if (window.getComputedStyle) {
        var compStyle = window.getComputedStyle(elem, "");
        return compStyle.getPropertyValue(CSSStyleAttr);
    }
    return "";
}


function mousemoved (e)
{
if(down)
{
	obj = document.getElementById("scroller");
	owner = document.getElementById("cont_prod_b");
	if(isMozilla) { ya = e.pageY; }
	else { ya=event.clientY; }
	
	if (getStart) { StartY=ya; StartTop = parseInt(obj.style.top); getStart = false;}

	dy = ya - StartY;
	
	y = StartTop + dy;
	if (y < 0 ) { dy = -StartTop;}
	if (y > ScrollHeight - 15 ) { dy = ScrollHeight - StartTop -15;}

	obj.style.top = StartTop + dy + 'px';
	
	ownerHeight = parseInt(getElementStyle("cont_prod_b", "height", "height"));
	if (!ownerHeight) { ownerHeight=200;}
	percent = (StartTop + dy)/ScrollHeight;
	ownerY = Math.round(ownerHeight*percent);
	ownerY = ownerY*(-1);
	owner.style.top = ownerY + 'px';
	
}

}
