/////////////////////////////////////////////////////////////////////////////////////// прокрутка, правое меню /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function lib_bwcheck(){ //Browsercheck (needed)
	this.ver=navigator.appVersion
	this.agent=navigator.userAgent
	this.dom=document.getElementById?1:0
	this.opera5=this.agent.indexOf("Opera 5")>-1
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0; 
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
	this.ie7=(this.ver.indexOf("MSIE 7")>-1 && this.dom && !this.opera5)?1:0;
	this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
	this.ie=this.ie4||this.ie5||this.ie6||this.ie7
	this.mac=this.agent.indexOf("Mac")>-1
	this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie7 || this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)

	return this
}
var bw=new lib_bwcheck()


// A unit of measure that will be added when setting the position of a layer.
var px = bw.ns4||window.opera?"":"px";

if(document.layers){ //NS4 resize fix...
	scrX= innerWidth; scrY= innerHeight;
	onresize= function(){if(scrX!= innerWidth || scrY!= innerHeight){history.go(0)} }
}

//object constructor...
function scrollerobj(obj,nest){
	nest = (!nest)?"":'document.'+nest+'.'
	this.elm = bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):document.getElementById(obj)
	this.css = bw.ns4?this.elm:this.elm.style
	this.doc = bw.ns4?this.elm.document:document
	this.obj = obj+'scrollerobj'; eval(this.obj+'=this')
	this.x = (bw.ns4||bw.opera5)?this.css.left:this.elm.offsetLeft

	if ( (navigator.userAgent.indexOf("Netscape") != -1 || navigator.userAgent.indexOf("Firefox") != -1) && obj == "dynPage" ){
			this.elm.style.position = "relative";
			var new_width = this.elm.offsetWidth;
			this.elm.style.position = "absolute";
			this.w = (bw.ie4||bw.ie5||bw.ie6||bw.ns6)?new_width:bw.ns4?this.elm.clip.width:bw.opera5?this.css.pixelWidth:0
	}
	else
		this.w = (bw.ie4||bw.ie5||bw.ie6||bw.ns6)?this.elm.offsetWidth:bw.ns4?this.elm.clip.width:bw.opera5?this.css.pixelWidth:0
}

//object methods...
scrollerobj.prototype.moveTo = function(x,y){
	if(x!=null){
		this.x=x;
		this.css.left=x+px;
	}
}
scrollerobj.prototype.moveBy = function(x,y){ this.moveTo(this.x+x,this.y+y) }

/****************************************************************
scroll functions...
***************************************************************/
var activePage = null;
var busy = 0;

function scroll(step){
	if ( !busy && (step<0 && activePage.x+activePage.w > scroller1.w || step>0 && activePage.x<0) )
		activePage.moveBy(step,0);
}


/**************************************************************
Init function...
**************************************************************/
var pageslidefadeLoaded = 0;
function initPageSlideFade(){

	scroller1 = new scrollerobj('divScroller','');

	pages = new Array();
	pages[0] = new scrollerobj('dynPage', 'divScroller');
	pages[0].moveTo(0,0);

	activePage = pages[0];
	pageslidefadeLoaded = 1;

}
//if the browser is ok, the script is started onload..
if(bw.bw && !pageslidefadeLoaded) onload = initPageSlideFade;
