/*-----------------------------------------------------------*\
|
|	navislider.js
|
\*-----------------------------------------------------------*/


function navislider(id, ia, cx, yd, ym) {

	var d = document;
	var w = window;
	
	var uAgent = navigator.userAgent.toLowerCase();
	var isMSI = (uAgent.indexOf("msie") != -1) && (uAgent.indexOf("opera") == -1);

	this.ia = ia;
	this.cx = cx;
	this.yd = isMSI ? yd : yd - 12;
	this.ym = ym;

	this.yp = 0;
	this.dy = 0;
	this.dt = 0;
	this.os = 0;
	this.is = 0;

	this.obj = d.getElementById ? d.getElementById(id) : d.all[id];
	this.obj.style.top = ((yd < ym) ? ym : yd) +'px';
	this.ref = 'navislider_' + id; eval(this.ref +' = this');

	this.slide = function(){
		var d = document;
		var w = window;
		var m = Math;
		var y = this.dt - this.yp;
		this.yp += (this.dy = this.dy * this.ia + y * this.cx);
		if(m.round(this.dy) != 0) w.setTimeout(this.ref +'.slide()', 10);
		else this.yp = this.dt;
		this.obj.style.top = m.floor(this.yp) +'px';
	}

	this.check = function(){
		var d = document;
		var w = window;
		var y = (w.pageYOffset)
			? w.pageYOffset
			: ((d.body && d.documentElement.scrollTop)
				? d.documentElement.scrollTop
				: 0
			)
		;
		if(y != this.os){
			this.os = y;
			this.is = 1
		} else if(this.is){
			this.is = 0;
			this.dt = y + this.yd - 270;
			this.dt = (this.dt < this.ym) ? this.ym : this.dt;
			this.slide();
		}
	}

	this.navislider_interval = w.setInterval(this.ref +'.check()', 300);
	w.offscreenBuffering = true;

}