/* Browser detection code by Kruglov */
isDOM=document.getElementById //DOM1 browser (MSIE 5+, Netscape 6, Opera 5+)
isOpera=isOpera5=window.opera && isDOM //Opera 5+
isOpera6=isOpera && window.print //Opera 6+
isOpera7=isOpera && document.readyState //Opera 7+
isMSIE=document.all && document.all.item && !isOpera //Microsoft Internet Explorer 4+
isMSIE5=isDOM && isMSIE //MSIE 5+
isNetscape4=document.layers //Netscape 4.*
isMozilla=isDOM && navigator.appName=="Netscape" //Mozilla Ё«Ё Netscape 6.*
/* End code */
/* Div scroll by Pimenov Dmitriy */
var timer;
var divWidth = 282;
var scrollWidth = 0;
var scrollSpeed = 400;
var scrollStep = 50;

if(isNetscape4 || isMozilla)
{
        scrollWidth = 18;
}
else
{
        scrollWidth = 16;
}

function myScrollStart(divID, dir)
{
        if (document.getElementById(divID)==null)
        {
            alert("Невозможно найти элемент с ID='" + divID + "'");
        }
        if (dir == 'left')
        {
                //timer=setInterval('myScrollUp()', scrollStep);
				myScrollLeft(divID);
        }
        if (dir == 'right')
        {
                //timer=setInterval('myScrollDown()', scrollStep);
				myScrollRight(divID);
        }
        if (dir == 'top')
        {
                //timer=setInterval('myScrollDown()', scrollStep);
				myScrollTop(divID);
        }
        if (dir == 'bottom')
        {
                //timer=setInterval('myScrollDown()', scrollStep);
				myScrollBottom(divID);
        }
}

function myScrollLeft(divID)
{
        //document.getElementById(divID).style.width = (divWidth+scrollWidth)+'px';
        //document.getElementById(divID).style.overflow='auto';
        document.getElementById(divID).scrollLeft-=scrollSpeed; 
}

function myScrollRight(divID)
{ 
        //document.getElementById(divID).style.width = (divWidth+scrollWidth)+'px';
        //document.getElementById(divID).style.overflow='auto';
        document.getElementById(divID).scrollLeft+=scrollSpeed;
}

function myScrollTop(divID)
{
        //document.getElementById(divID).style.width = (divWidth+scrollWidth)+'px';
        //document.getElementById(divID).style.overflow='auto';
        document.getElementById(divID).scrollTop-=scrollSpeed/2;
}

function myScrollBottom(divID)
{
        //document.getElementById(divID).style.width = (divWidth+scrollWidth)+'px';
        //document.getElementById(divID).style.overflow='auto';
        document.getElementById(divID).scrollTop+=scrollSpeed/2;
}

function myScrollClear()
{ 
        clearInterval(timer);
}
/* End code */
