ncou = 0;
scrar = [];

scrollInfo = function () {
	var self = this;
	var obOut = null;
	var obInt = null;
	var sizeup;
	ncou++;
	var nCur = ncou;
	var tOb = null;
	scrar[ncou] = this;

	this.setScrollOb = function (sObOut, sObInt ) {
//		var ntop;
		var ndop = 30;
		if(document.getElementById){
			obOut = sObOut; // document.getElementById(sObOut)
			obInt = sObInt; // document.getElementById(sObInt);
			obInt.style.top=0;
			sizeup=obInt.offsetHeight + ndop - obOut.offsetHeight;
			if( sizeup < 0 ) sizeup = 0;
		}
		else 
			if(document.layers){
				obOut = sObOut; // document.ns4div
				obInt = sObInt; // document.ns4div.document.ns4div1
				obInt.top=0;
				sizeup=obInt.document.height + ndop - obOut.document.height;
			}
			else 
				if(document.all){
					obOut = sObOut; // ns6divout
					obInt = sObInt; // iens6div
					obInt.style.pixelTop=0;
					sizeup=obInt.offsetHeight + ndop - obOut.offsetHeight;
				}
	}

	this.scrollStop = function () {
		if( tOb != null ) clearTimeout(tOb);
	}

	this.scrollOb = function (nVal) {
		if( obInt == null ) return;
		var s1 = "scrar["+nCur+"].scrollOb("+nVal+")";
		if(document.getElementById){
			if( nVal > 0 ) {
				if(parseInt(obInt.style.top)>sizeup*-1) {
					obInt.style.top=parseInt(obInt.style.top)-nVal;
					tOb = setTimeout(s1, 100);
				}
				else tOb = null;
			}
			else {
				if(parseInt(obInt.style.top)<0) {
					obInt.style.top=parseInt(obInt.style.top)-nVal;
					tOb = setTimeout(s1, 100);
				}
				else tOb = null;
			}
		}
		else 
			if(document.layers){
//***************************
//				alert('obInt.top = ' + obInt.top + ' obOut.top = ' + obOut.top + ' sizeup = ' + sizeup);
				if( nVal > 0 ) {
					if( obInt.top > sizeup*-1) {
						obInt.top = obInt.top - nVal;
						tOb = setTimeout(s1, 100);
					}
					else tOb = null;
				}
				else {
					if( obInt.top < 0) {
						obInt.top = obInt.top - nVal;
						tOb = setTimeout(s1, 100);
					}
					else tOb = null;
				}
//***************************
			}
			else 
				if(document.all){
//***************************
					if( nVal > 0 ) {
						if( obInt.style.pixelTop > sizeup*-1) {
							obInt.style.pixelTop = obInt.style.pixelTop - nVal;
							tOb = setTimeout(s1, 100);
						}
						else tOb = null;
					}
					else {
						if( obInt.style.pixelTop < 0) {
							obInt.style.pixelTop = obInt.style.pixelTop - nVal;
							tOb = setTimeout(s1, 100);
						}
						else tOb = null;
					}
//***************************
				}
	}

};

function mkScroll(sName, nWd, nHi, sText, sOb, sClass) {
	if(document.layers) {
		document.write('<ilayer class="'+sClass+'" id="'+sName+'" width='+nWd+' height='+nHi+'><layer id="'+sName+'1" width='+(nWd-3)+' height='+nHi+'>'+sText+'</layer></ilayer>'); // conf
	}
	if(document.getElementById||document.all) {
		nw = nWd;
		if( /Opera/.test(window.navigator.appName) ) nHi += 20;
		if( /Netscape/.test(window.navigator.appName) && /Mozilla/.test(window.navigator.appCodeName) && (parseInt(window.navigator.appVersion) >= 5) ) nw -= 3;
		document.write('<div id="'+sName+'" class="'+sClass+'" style="position:relative;overflow:hidden;width:'+nw+'px;height:'+nHi+'px;clip:rect(0 '+nw+' '+nHi+' 0);"><div id="'+sName+'1" style="position:relative;width:'+(nw-3)+'px;">'+sText+'</div></div>');
	}
	document.write('<div class="stop"></div><div style="float: left; margin-left: 4px; margin-right: 6px; border: 0px none #ffffff;"><a href="#" onmouseover="'+sOb+'.scrollOb(5);" onmouseout="'+sOb+'.scrollStop();" onClick="return false;"><img src="/pic/remicon.ru/arr1.gif" border=0 alt=""></a>&nbsp;<a href="#"  onmouseover="'+sOb+'.scrollOb(-5);" onmouseout="'+sOb+'.scrollStop();" onClick="return false;"><img src="/pic/remicon.ru/arr2.gif" border=0 alt=""></a></div>');
}

function start(){
	if(document.layers){
		o1.setScrollOb(document.divforum, document.divforum.document.divforum1);
		o2.setScrollOb(document.divpnew, document.divpnew.document.divpnew1);
		o2.setScrollOb(document.divnews, document.divnews.document.divnews1);
	}
	if(document.getElementById) {
		o1.setScrollOb(document.getElementById('divforum'), document.getElementById('divforum1'));
		o2.setScrollOb(document.getElementById('divpnew'), document.getElementById('divpnew1'));
		o3.setScrollOb(document.getElementById('divnews'), document.getElementById('divnews1'));
	}

	if(document.all) {
		o1.setScrollOb(divforum, divforum1);
		o2.setScrollOb(divpnew, divpnew1);
		o3.setScrollOb(divnews, divnews1);
	}
}

function roll(sid){
	if(document.getElementById) {
		var osh = document.getElementById(sid);
		if( osh ) {
			if( osh.style.visibility !== 'visible' ) {
				osh.style.visibility = 'visible';
				osh.style.display = 'block';
			}
			else {
				osh.style.visibility = 'hidden';
				osh.style.display = 'none';
			}
		}
	}
}